agentleFS
jhammantjhammant/shelf/AGENTS.md

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.

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
  1. Very specific:

    If it is already shelved, lead with the recorded verdict and reasoning rather than researching from scratch.

    line 22
  2. Very specific:

    Always shelf find first; never list/print to answer a question.

    line 40
  3. Very specific:

    Run shelf constraints once at session start and keep it in context.

    line 41
  4. Very specific:

    Never read constraints.md or the shelf's generated README.md directly.

    line 43
  5. Very specific:

    Never run shelf stats and never read log.jsonl.

    line 46
  6. Very specific:

    Never search or read repos/ — vendored clones of other people's code, gitignored so ripgrep skips them.

    line 51
  7. Very specific:

    If find misses, run shelf tags and retry with a real tag.

    line 53
  8. Very specific:

    When the user says something that contradicts a live constraint ("we run Redis now"), offer shelf constraint <id> --lift — it finds every …

    line 54
  9. Very specific:

    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 …

    line 64
  10. Distinctive:

    Always fill in the note body afterwards:

    line 66

≈ “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.

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

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.

KindVerdictsMeans
tooluntried → trialling → adopted / rejecteda library, service or binary
readingunread → useful / noisean 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:

CommandCost @100 itemsScales?Use
shelf constraints~150 tokno, O(1)once per session, then keep it
shelf find <q>~210 tokno, capped at 8always start here
shelf revisit <id>~270 tokno, capped at 8when a constraint changes
shelf tags~250 toknowhen a search misses
shelf show <slug>~535 toknoafter find, 1–2 max
shelf list / print / stats0.3–4k tokyes, linearhuman terminal only — not you
every note~51,000 tok—never

Rules:

  1. Always shelf find first; never list/print to answer a question.
  2. Run shelf constraints once 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.
  3. Never read constraints.md or the shelf's generated README.md directly. constraints.md carries ~90 tokens of header prose that shelf constraints never prints; the README is a generated human index that duplicates find at many times the cost.
  4. Never run shelf stats and never read log.jsonl. The report is small but --dead and --json are linear, the computation reads every item plus the whole usage log, and the user's query history is not your business. Leave SHELF_NO_LOG unset too: find and show log one line each, and your piped calls are how the user sees the shelf working.
  5. shelf show at most two notes, only ones find ranked highly.
  6. Never search or read repos/ — vendored clones of other people's code, gitignored so ripgrep skips them. Don't defeat that with --no-ignore.
  7. If find misses, run shelf tags and retry with a real tag.
  8. 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, offer shelf 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.

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.