token-lean
AGENTS.md1 starsChanged 5 months agoMITView on GitHub
Copy this file into any repo root (or ~/.codex/AGENTS.md for Codex global config) to get token-lean behavior from Codex, Cursor, Copilot, or any agent that reads AGENTS.md. It is the tool-agnostic distillation of the token-lean Claude Code plugin — no hooks required. - Locate before reading: search for the symbol, then read only the matching region. Never read a whole file when a 60-line window answers the question. - Never re-read a file already in context unless it changed on…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Never re-read a file already in context unless it changed on disk.
- Very specific: line 13
Use terse command flags: git status --porcelain -b, git log --oneline -15, git diff --stat first, ls -1, pytest -q.
- Distinctive: line 20
Before writing any code, stop at the first rung that works:
- Distinctive: line 26
Only then write new code — and make it small.
- Distinctive: line 28
No dead code "for later", no duplicated logic, no boilerplate comments, no docstrings that restate the signature.
- Distinctive: line 34
Do not narrate steps or restate the task.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Token-Lean Rules (portable)
Copy this file into any repo root (or ~/.codex/AGENTS.md for Codex global
config) to get token-lean behavior from Codex, Cursor, Copilot, or any agent
that reads AGENTS.md. It is the tool-agnostic distillation of the token-lean
Claude Code plugin — no hooks required.
Read less
- Locate before reading: search for the symbol, then read only the matching region. Never read a whole file when a 60-line window answers the question.
- Never re-read a file already in context unless it changed on disk.
- Use terse command flags:
git status --porcelain -b,git log --oneline -15,git diff --statfirst,ls -1,pytest -q. - Pipe long output through filters (
| head -50,| grep <pattern>). Never dump raw logs, full test output, or dependency trees.
Write less
Before writing any code, stop at the first rung that works:
- Does this need to exist at all? Deleting code can be the fix.
- Does it already exist in the codebase? Reuse or extend it.
- Does the standard library cover it? No new dependency.
- Can it be one line, or a few? No speculative parameters or wrappers.
- Only then write new code — and make it small.
No dead code "for later", no duplicated logic, no boilerplate comments, no docstrings that restate the signature.
Say less
- Answer first; detail only if asked.
- Do not narrate steps or restate the task. Show the result.
- One-sentence completion notes. Never paste back code just written to a file.
- Match answer length to question weight.
When NOT to economize
- Correctness-critical reads (security review, migrations): read everything.
- The user explicitly asks for detail or teaching.
- Ambiguity where a wrong guess costs a full redo: ask one precise question.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

