agentleFS
gviiisengviiisen/repo-context-ledger/AGENTS.md

repo-context-ledger

AGENTS.md105 starsChanged 3 months agoMITView on GitHub

Before any Ledger call, use current conversation and inspected facts to judge the new delta, not whether task wording looks similar. With sufficient context, routine questions/rechecks/operations use ordinary tools and no new Ledger lifecycle. In a known unfinished task, keep its session/epoch and update only new changes, findings, and results; do not rewrite unchanged background. Similar work on different behavior or inputs still needs its real delta recorded. After a record is completed, new changes require a new record, not…

  • 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 repository4 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Update docs/specs/ and refresh affected Context Packs when current behavior, contracts, boundaries, code navigation, or tracked production …

    line 22
  2. Very specific:

    Before opening or updating a pull request, update the base ref and run policy --base origin/main.

    line 25
  3. Very specific:

    Do not ask the user to run bookkeeping commands.

    line 31

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

Agent instructions

<!-- repo-context-ledger:rules:start -->

Repository context ledger

Before any Ledger call, use current conversation and inspected facts to judge the new delta, not whether task wording looks similar. With sufficient context, routine questions/rechecks/operations use ordinary tools and no new Ledger lifecycle. In a known unfinished task, keep its session/epoch and update only new changes, findings, and results; do not rewrite unchanged background. Similar work on different behavior or inputs still needs its real delta recorded. After a record is completed, new changes require a new record, not reopening history. Query only missing identity/context, without a new classification command, document, or automatic rescan. Reuse execution methods, not stale verification or authorization; necessary fresh checks and relevant code reading remain mandatory.

Resolve an unidentified new request or fresh window with plan --query "<user request>" --tool <agent>. Follow its mode and next_action; clarify when requires_confirmation is true. Inside a known task, retain its session and epoch without repeating plan/status/context/focus unless identity, scope, repository, or an unresolved question changes. Read-only work never starts a session. A bounded configuration change uses start --kind local-config --workflow small-fix → verify --sensitive -- <direct executable and arguments> → finish --path <changed-config>. A known small fix uses start --workflow small-fix → implement → acceptance verify → finish. Use status only to resolve uncertain task state. Prefer an exact reviewed preset; preserve preset trust and ordinary behavior gates.

Runtime mode: bundled. Use the repository .context-ledger/ledger.py entry. In global mode it forwards to the installed Codex Skill under CODEX_HOME (or the user's .codex); keep all configuration and history in this repository, and do not overwrite the forwarder with an old runtime.

For a known scoped small fix, skip context/focus and a separate evidence command; broad dirty work or parallel sessions still requires explicit task-scoped evidence.

For every feature, bug fix, refactor, interface change, or other ordinary behavior-changing code task:

  1. Before editing code, start or reuse only this task's identified private draft session; resolve unknown identity with plan/status, not repeated boilerplate calls. Keep one session for a bounded logical request, including code, tests, and related documentation; archive once, but update its draft as meaningful facts emerge. Preserve changed diagnoses, key decisions, and relevant failures before switching context. Do not combine unrelated requests or independently deliverable work merely to reduce record counts. Pass the session ID and any returned epoch on lifecycle writes. start --workflow readonly|resume must fail rather than create duplicate work.
  2. Resolve quality.language; when it is auto, follow nearby docs or the user's language. Keep paths, symbols, commands, and error text untranslated.
  3. For missing or changed background, Use already loaded task context first. For a missing or changed background question, run context --query "<task>" before broad documentation exploration; do not repeat routing for a routine follow-up whose context is sufficient. Read only the Context Bundle's Required reads initially. Never recursively read docs/ai, docs/specs, or docs/changes. Do not open completed Change bodies unless the plan selects one, a required Pack cites one for a named reason, or the user asks for historical reasoning. Required reads are a starting route, not a maximum code-reading limit. Expand context only after stating the unresolved question, and always expand whenever callers, implementations, configuration, persistence, permissions, concurrency, retries, tests, or external boundaries can affect the behavior. Focus a selected feature Pack when establishing an unknown route, not on every subsequent turn. Existing relevant code knowledge may be reused for any task size, but new or uncertain behavior boundaries require investigation. Create a Pack only when the work needs new durable feature navigation, not per follow-up.
  4. A same-window 'continue' on a known active task keeps its session and epoch without another resume. For a real window/tool handover, paused task, or missing task identity, resolve only the missing state and use an owned unique Resume Capsule. Continue the same Ledger session with resume --query "<keywords>" --tool <agent>; keep the returned continuation epoch and pass --epoch <n> to later writes. Never read, resume, pause, checkpoint, finish, or invalidate another principal's private session unless an explicit unexpired grant authorizes that exact access. Read-only grants never permit writes. A foreign overlap without a grant permits only Git-tracked Pack/spec/Change guidance. Run checkpoint --session <id> --summary "..." --next "..." before handing active work to another Agent. Pause only this task's session; never pause, resume, or finish another task's session.
  5. Use ordinary tools for reads, searches, file generation, preparation, and authorized deployment; do not wrap each operation in verify. Choose acceptance goals and run each through verify when first needed, without a bare run followed by a duplicate logging run. Group related checks using a reviewed project script or exact preset, preserving each step result and a failed aggregate exit when any step fails. Keep pre-deployment and post-deployment checks separate, and never replay a deployment, authorization, migration, or trade to obtain logging. Independent checks may run concurrently only without shared mutable resources. Presets remain explicit-only; inspect a requested trust digest before trusting. Use direct argv or PowerShell -File, not nested command strings. Wait for verification appends before editing the draft or finishing. Useful operational observations belong in the draft but cannot be relabeled as managed passes. Use not-run only for genuinely unavailable verification.
  6. Let finish capture evidence for a single-session small fix. Run explicit evidence --path only when another session exists or automatic collection is too broad; never capture foreign dirty paths.
  7. Update docs/specs/ and refresh affected Context Packs when current behavior, contracts, boundaries, code navigation, or tracked production paths change.
  8. Finish with finish --spec <affected-spec>, or use --no-spec --reason "..." only when no stable behavior exists.
  9. Let finish enforce this session's evidence, specs, and relevant Context Pack fingerprints. A small-fix draft still needs explanations of each meaningful change, with repository-relative file/symbol citations, plus the reason docs changed or remain correct. Group coupled files; shared boundaries and managed verification need not be repeated per item. Only the documentation Updated list is auto-filled; paths are not explanations. Unknown scope, independent behavior changes, or high risk require expanding the same draft to ordinary work without losing decisions or evidence. Optional finish --dry-run reports resolvable requirements without writes; it is not a mandatory step. Run repository-wide check --strict --coverage only at integration or PR time, when foreign sessions are not actively changing the shared worktree.
  10. Before opening or updating a pull request, update the base ref and run policy --base origin/main. Use audit --history --policy as-recorded --fail-on unresolved only for controlled historical/release audits.

Active and paused drafts are stored in Git worktree metadata and must not be committed. Only finish may publish a validated draft into docs/changes/. On feature branches, do not regenerate shared README or monthly index blocks. After merging on main, run python .context-ledger/ledger.py sync --derived once.

Never send a message, delegation, follow-up prompt, or steering instruction to another user-owned task or thread unless the user explicitly requested cross-task coordination. A foreign dirty path, stale Pack, failed global check, or shared worktree is not permission. Do not repair another session's docs to unblock this task. The ledger does not copy, lock, merge, or coordinate source-code edits; leave code conflicts to the host Agent and Git without interrupting another task.

Do not ask the user to run bookkeeping commands. Do not create a handoff for read-only analysis or formatting-only work. Preserve prose outside repo-context-ledger managed markers.

<!-- repo-context-ledger:rules:end -->

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.