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.
Which files Sourcery reads
Section titled “Which files Sourcery reads”Sourcery looks for these files anywhere in the repository.
| File or pattern | Tool |
|---|---|
AGENTS.md, AGENT.md | Codex, Amp and other AGENTS.md agents |
CLAUDE.md, .claude/CLAUDE.md, .claude/rules/**/*.md | Claude Code |
GEMINI.md | Gemini CLI |
.cursorrules, .cursor/rules/**/*.mdc, .cursor/BUGBOT.md | Cursor, Cursor Bugbot |
.windsurfrules, .windsurf/rules/*.md | Windsurf |
.github/copilot-instructions.md, .github/instructions/**/*.instructions.md | GitHub Copilot |
.clinerules, or any file in a .clinerules/ folder | Cline |
SOURCERY.md | Sourcery only |
Sourcery only sees files committed to the repository. It doesn’t read your personal ~/.claude/CLAUDE.md or an uncommitted CLAUDE.local.md.
Where a file applies
Section titled “Where a file applies”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 repositoryservices/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.
What Sourcery does with the files
Section titled “What Sourcery does with the files”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.
What a comment looks like
Section titled “What a comment looks like”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:
- 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:
**🟡 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
Section titled “SOURCERY.md”SOURCERY.md holds guidance for Sourcery alone, and your coding agents don’t read it. Put review-only notes there:
- `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.Limitations
Section titled “Limitations”Agent instruction files don’t apply yet if you bring your own LLM through an Anthropic or Gemini deployment or a proxy.