shelf
AGENTS.md1 starsChanged 3 months agoMITView on GitHub
Portable version of the Claude Code skill in skills/claude-code/. Append the relevant part to your own AGENTS.md, .cursorrules, or copilot-instructions.md. The user keeps evaluated tools and reading in shelf ($SHELF_DIR, default ~/.shelf) — notes in items/*.md, standing facts in constraints.md. The two sets share no word, so the verdict in find output tells you the kind for free. noise means "read it, nothing in it". Before recommending any tool, library, or framework, run shelf find <topic> first. If it is…
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 31,774 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.
- shelfSkill
The file
We split this AGENTS.md into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
If it is already shelved, lead with the recorded verdict and reasoning rather than researching from scratch.
- Very specific: line 40
Always shelf find first; never list/print to answer a question.
- Very specific: line 41
Run shelf constraints once at session start and keep it in context.
- Very specific: line 43
Never read constraints.md or the shelf's generated README.md directly.
- Very specific: line 46
Never run shelf stats and never read log.jsonl.
- Very specific: line 51
Never search or read repos/ — vendored clones of other people's code, gitignored so ripgrep skips them.
- Very specific: line 53
If find misses, run shelf tags and retry with a real tag.
- Very specific: line 54
When the user says something that contradicts a live constraint ("we run Redis now"), offer shelf constraint <id> --lift — it finds every …
- Very specific: line 64
When shelving with shelf add <url> [-k tool|reading] -w "why" -t tags, the kind is inferred from the URL — override it with -k, or correct …
- Distinctive: line 66
Always fill in the note body afterwards:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Shelf — agent instructions
Portable version of the Claude Code skill in skills/claude-code/. Append the relevant
part to your own AGENTS.md, .cursorrules, or copilot-instructions.md.
shelf
The user keeps evaluated tools and reading in shelf ($SHELF_DIR, default ~/.shelf) —
notes in items/*.md, standing facts in constraints.md.
| Kind | Verdicts | Means |
tool | untried → trialling → adopted / rejected | a library, service or binary |
reading | unread → useful / noise | an article, paper or talk — consumed for ideas |
The two sets share no word, so the verdict in find output tells you the kind for free.
noise means "read it, nothing in it".
Before recommending any tool, library, or framework, run shelf find <topic> first.
If it is already shelved, lead with the recorded verdict and reasoning rather than
researching from scratch. A rejected verdict is a finding: say what the blocker was and
whether it still holds.
Retrieval is two steps and bounded, because this output lands in your context window:
| Command | Cost @100 items | Scales? | Use |
shelf constraints | ~150 tok | no, O(1) | once per session, then keep it |
shelf find <q> | ~210 tok | no, capped at 8 | always start here |
shelf revisit <id> | ~270 tok | no, capped at 8 | when a constraint changes |
shelf tags | ~250 tok | no | when a search misses |
shelf show <slug> | ~535 tok | no | after find, 1–2 max |
shelf list / print / stats | 0.3–4k tok | yes, linear | human terminal only — not you |
| every note | ~51,000 tok | — | never |
Rules:
- Always
shelf findfirst; neverlist/printto answer a question. - Run
shelf constraintsonce at session start and keep it in context. Never re-run it per query — five runs turn a 150-token asset into a 750-token leak. - Never read
constraints.mdor the shelf's generatedREADME.mddirectly.constraints.mdcarries ~90 tokens of header prose thatshelf constraintsnever prints; the README is a generated human index that duplicatesfindat many times the cost. - Never run
shelf statsand never readlog.jsonl. The report is small but--deadand--jsonare linear, the computation reads every item plus the whole usage log, and the user's query history is not your business. LeaveSHELF_NO_LOGunset too:findandshowlog one line each, and your piped calls are how the user sees the shelf working. shelf showat most two notes, only onesfindranked highly.- Never search or read
repos/— vendored clones of other people's code, gitignored so ripgrep skips them. Don't defeat that with--no-ignore. - If
findmisses, runshelf tagsand retry with a real tag. - When the user says something that contradicts a live constraint ("we run Redis now"),
offer
shelf constraint <id> --lift— it finds every decision that rested on it. When they state a new durable fact, offershelf constraint no-k8s "we do not run Kubernetes"(ids lowercase, ≤24 chars,[a-z0-9._-]). Keep the set under ~12 — it is loaded every session.
A why line prefixed with a constraint id (single-node · Token bucket limiter…) means the
decision rested on that standing fact. Resolve the id against the constraint set you already
loaded; do not re-read anything.
When shelving with shelf add <url> [-k tool|reading] -w "why" -t tags, the kind is inferred
from the URL — override it with -k, or correct it later with shelf kind <slug> reading.
Always fill in the note body afterwards:
- tool: What it is (mechanics, concrete) · When I'd reach for it (name the project) · Why not now (the honest blocker — the most valuable section) · If I trial it (exact setup).
- reading: What it argues · What I took from it · What I'd push back on (the load-bearing one — a summary with no disagreement is just the abstract) · Where I'd apply it.
Link a decision to the fact that caused it with
shelf verdict <slug> rejected --because single-node.
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.

