Skip to content

Agent instruction files

Documentation Index

Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt

Use this file to discover all available pages before exploring further.

Your team already writes down its conventions for coding agents, in files like CLAUDE.md and AGENTS.md. Sourcery reads those files and reviews each pull request against them, and when a comment comes from one, it quotes the rule and links to it. There’s nothing to set up: merge the files, and the pull requests that follow are reviewed against them.

Sourcery looks for these files anywhere in the repository.

File or patternTool
AGENTS.md, AGENT.mdCodex, Amp and other AGENTS.md agents
CLAUDE.md, .claude/CLAUDE.md, .claude/rules/**/*.mdClaude Code
GEMINI.mdGemini CLI
.cursorrules, .cursor/rules/**/*.mdc, .cursor/BUGBOT.mdCursor, Cursor Bugbot
.windsurfrules, .windsurf/rules/*.mdWindsurf
.github/copilot-instructions.md, .github/instructions/**/*.instructions.mdGitHub Copilot
.clinerules, or any file in a .clinerules/ folderCline
SOURCERY.mdSourcery only

Sourcery only sees files committed to the repository. It doesn’t read your personal ~/.claude/CLAUDE.md or an uncommitted CLAUDE.local.md.

Each file applies to changes in its own folder and everything below it, and one at the root covers the whole repository. Inside a tool’s folder, such as .claude/, .cursor/ or .github/, a file applies as if it sat next to that folder. Rules files that list their own paths or globs apply only to the files that match.

CLAUDE.md # the whole repository
services/billing/AGENTS.md # everything under services/billing/
web/.cursor/BUGBOT.md # everything under web/

A pull request that only changes services/billing/ is reviewed against the root CLAUDE.md and the billing AGENTS.md.

Sourcery picks out the rules a change must follow and the facts that help judge one, like the language version you target. It leaves out workflow instructions, like which branch to open pull requests against. It also reads the files a CLAUDE.md or AGENTS.md imports, and the guides a file says changes must follow, a style guide for instance.

Sourcery flags a broken rule only where the pull request’s own changes break it. A rule that tells reviewers not to report something, such as “Don’t flag missing type hints in scripts/”, stops those comments.

Each file is read as it is at the pull request’s base commit. A pull request that edits CLAUDE.md is reviewed against the version it started from.

A comment that comes from one of your files reads like any other review comment, with the rule quoted at the end. Say the CLAUDE.md in an example repository, acme/payments, includes:

CLAUDE.md
- Store and compute amounts as integer cents. Never use floats for money.

A pull request adds amount = float(request.json["amount"]) to the refund handler, and Sourcery comments on that line:

Sourcery's comment
**🟡 Medium · Refund amount parsed as a float**
When a refund request arrives, `create_refund` reads `amount` with `float()`, so an amount like 19.99 is stored with a rounding error and the refunded total can be off by a cent.
Parse the amount as a decimal string and convert it to integer cents before storing it.
From [`CLAUDE.md` L3](https://github.com/acme/payments/blob/<base-sha>/CLAUDE.md#L3):
```markdown
- Store and compute amounts as integer cents. Never use floats for money.
```

SOURCERY.md holds guidance for Sourcery alone, and your coding agents don’t read it. Put review-only notes there:

SOURCERY.md
- `legacy/` is frozen until it's deleted in Q1. Don't report style issues there.
- Every new file in `migrations/` needs a matching down migration.

Agent instruction files don’t apply yet if you bring your own LLM through an Anthropic or Gemini deployment or a proxy.