agentleFS
EswarSkEswarSk/token-lean/AGENTS.md

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 checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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.

  • In this repositoryOne other file it gives its agents.

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
  1. Distinctive:

    Never re-read a file already in context unless it changed on disk.

    line 12
  2. Very specific:

    Use terse command flags: git status --porcelain -b, git log --oneline -15, git diff --stat first, ls -1, pytest -q.

    line 13
  3. Distinctive:

    Before writing any code, stop at the first rung that works:

    line 20
  4. Distinctive:

    Only then write new code — and make it small.

    line 26
  5. Distinctive:

    No dead code "for later", no duplicated logic, no boilerplate comments, no docstrings that restate the signature.

    line 28
  6. Distinctive:

    Do not narrate steps or restate the task.

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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 --stat first, 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:

  1. Does this need to exist at all? Deleting code can be the fix.
  2. Does it already exist in the codebase? Reuse or extend it.
  3. Does the standard library cover it? No new dependency.
  4. Can it be one line, or a few? No speculative parameters or wrappers.
  5. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.