backpass is a local tool that reviews coding-agent session transcripts and proposes evidence-backed changes to an agent's memory files, such as AGENTS.md and project skills. Developers use it to improve agent instructions from past work while keeping a person responsible for approving and applying edits. The catalogue entries are instructions for using backpass.
Borrowing it
Nothing to install: this file belongs to kunchenguid/backpass. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/kunchenguid/backpass/main/AGENTS.mdgit clone --depth 1 https://github.com/kunchenguid/backpassWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/kunchenguid/backpass/agents-md)<a href="https://agentmods.dev/instructions/kunchenguid/backpass/agents-md"><img src="https://agentmods.dev/badge/instructions/kunchenguid/backpass/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/kunchenguid/backpass/agents-md"><img src="https://agentmods.dev/badge/instructions/kunchenguid/backpass/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01911 | $0.01911 |
| Opus 5.5 | $0.00764 | $0.00764 |
| Sonnet 5.5 | $0.00382 | $0.00382 |
| Haiku 4.5 | $0.00191 | $0.00191 |
Grade A, and why
backpass AGENTS.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- **Spawns**: a Windows shim refusal (`ERR_WINDOWS_SHIM_UNSAFE_ARG`, `src/subprocess.js`) must be raised by name How it starts
The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Project agent memory
backpass is an npm CLI that runs a "backward pass" over a repo's agent memory files: it
discovers past agent-session transcripts tied to the repo, analyzes them, and proposes
evidence-backed edits to AGENTS.md / CLAUDE.md under a token budget.
Orientation
VISION.mdis the acceptance policy; run its closing accept/resist test againstVISION.mdalone.README.mddocuments the user-facing surface and how each stage works;src/cli.jsis the authoritative flag list.- Pipeline, one stage per module:
src/discovery/->src/sample.js->src/distill.js->src/analyze.js->src/consolidate.js+src/fold.js->src/synthesize.js(src/workspace.js,src/diff.js) ->src/proposal.js->src/apply/. Read a module's header comment before changing its stage. - User-facing step names are training-loop terms (
STAGE_LABELSinsrc/tui/render.js); internal keys and subcommands (scan,analyze,propose) keep short names. Never introduce a multi-word subcommand. - Zero runtime dependencies, ESM, no build step, Node >= 22.5 (
node:sqlite). pnpm;pnpm run checkruns lint, format:check, typecheck, and offline tests (fixtures undertest/fixtures/). - Releases are release-please; never hand-edit
CHANGELOG.mdor.release-please-manifest.json. .github/workflows/no-mistakes-required.ymlcalls the upstreamrequire-no-mistakesaction pinned to a commit SHA (never@main); change enforcement upstream, bump the pin in a separate PR, and push throughgit push no-mistakes(seeCONTRIBUTING.md).
Hard invariants
Each owning file's comments and tests hold the detail; read them before touching the area.
- Only
src/apply/writer.jswrites to the repo; every other stage is read-only. Apply writes nothing unless every hash, budget, composition, skill-dir, and target gate passes, and each file lands whole or not at all. Bootstrap (src/commands/bootstrap.js) only ever creates files. - Synthesis edits a staging copy (
.backpass/synthesis/,prepareWorkspace). Never passapproveAllwith the repo ascwd; staging and the fingerprint stay in step exceptskillSearchPathsskills are withheld but fingerprinted: a direct write failsassertRepoUntouched(src/synthesize.js). Keep that protection. The model never suppliesfindtext; hunks are cut from the raw file (anchoredHunks). - Never trust model-reported numbers. Token deltas, budgets, and session counts are measured in
src/proposal.js; usage comes from acpx's response metadata, stderr line, or a harness store (src/acpx.js), printed only bysrc/commands/usage.js. - Evidence floors live in
buildProposal(src/proposal.js): every non-extract/moveedit needsminGapEvidencedistinct sessions fromsummary.sources; deletions needharm-class sessions; a pure deletion inside a skill file is refused. Extraction and deletion never share one decision. Never add a lexical or text-shape classifier to these gates, and non-compliance never counts as harm. The >= 20% relevance placement table (src/prompts/synthesis.md) stays prompt guidance, never abuildProposalgate. - Quotes must be found in the trace they cite (
sanitizeEvidenceinsrc/analyze.js), so fake agents in tests must quote real session text. BumpANALYSIS_INDEX_VERSION(src/state.js) for any change to what analysis accepts. - Sampling is deterministic and sticky (
src/sample.js): a per-transcript hash oftranscriptIdentityandconfig.seed, neverMath.random()or an index/position-derived draw. - Corpus mix is interactive vs non-interactive, never an unknown bucket (
src/interaction.js). - backpass must never analyze itself: keep
SELF_SESSION_SENTINEL(src/prompts.js) at the start of every model-facing prompt (src/discovery/self.jsdrops those sessions). - Gap evidence: one ledger sighting per (gap, transcript) (
src/gap-ledger.js); record before pruning; never surface uncorroborated singletons; gap identity is judged by the consolidation call, with bigram similarity only as fallback; there is no orchestrator-memory write path. - Fold uses only selected, fresh evidence (
foldForRuninsrc/commands/propose.js,isEvidenceFresh). - Presentation never gates: the apply funnel counters and cross-surface duplicates (
src/overlap.js) are report-only. - Scopes and targets: user-scope state never enters
<repo>/.backpass/and a project run never writes a user file (src/scope.js).--targetaccepts only an exact configured memory file or skill name (src/target.js), never a basename, directory, or glob. - SSH hosts (
src/discovery/hosts.js):src/discovery/remote/ssh.jsis the only ssh spawn boundary; nothing installs remotely and the probe bundle must stay self-contained (PROBE_MANIFEST);discovery.hostsin a repo's.backpassrc.jsonis an error; host keys are never auto-accepted. Remote cache names are hashed (src/discovery/cache.js) and a short fetch is never analyzed as a whole session. - Adapters drift and must stay fail-soft: fix an adapter and its golden fixture together
(
src/discovery/adapters/). Hermes ingestscli/acp, plustuionly with an absolute cwd (see its header). - Skills (
src/skills.js): a bareskills/dir is never auto-detected; writes never targetskillSearchPaths; search-path and out-of-repo skills are withheld from staging (src/workspace.js). - Memory resolution is pointer-aware (
resolveMemoryFilesinsrc/memory.js); a second full file is warned about, never silently ignored or double-written. - Spawns: a Windows shim refusal (
ERR_WINDOWS_SHIM_UNSAFE_ARG,src/subprocess.js) must be raised by name before any generic result handling at every spawn boundary. All model calls go throughsrc/acpx.js(acpx is alpha); only session creation gets the cold-start timeout, and a timeout (result.timedOut, or acpx's own exit 3,ACPX_EXIT_TIMEOUT) is handled before generic exits. - Model and effort overrides are invocation-scoped (
src/harness-invoke.js): never ACPset modelor Piset thought_level, never edit-then-restore harness defaults. - Agent auto-pick is probe-then-verify (
src/agents.js,AgentResolver.withFallthrough); a timeout or bare exit is never cached as a negative probe. An ambiguous advertised model is ranked by auth class (src/provider-auth.js) or fails loudly, never guessed. - Lavish apply surface (
src/apply/lavish.js): parse URLs withextractUrl, and splice the payload with a function replacer, never a string one (untrusted text can contain$&). - The live TUI is an enhancement layer (
src/tui/): output must be identical with it inactive (non-TTY, CI,NO_COLOR,--quiet,--json), with clean stdout. - Rejection identity (
src/state.js): a refused add/rewrite/remove stays suppressed on the same kind and file when measuredgapIdsorinstructionIdsoverlap, until a strictly higher session count; extract/move stay hunk-key only. Optional reject reasons never revive an edit and are not evidence floors. - Cursor IDE support is deferred; see the header of
src/discovery/adapters/cursor-ide.js.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago Changed · +4 tokens per session 5de4e3cebd34
- 1mo ago Changed · +17 tokens per session 4357bae9c495
- 1mo ago Changed · +3 lines · +72 tokens per session 6e8a0d7554bb
- 1mo ago Changed · +8 tokens per session b6c06526f77d
- 1mo ago Changed · -317 lines · -6,201 tokens per session d1028f462ecf
- 1mo ago Changed · +13 lines · +249 tokens per session b779641a2bea
- 1mo ago Changed · +12 lines · +248 tokens per session 8d20a2bdc0ab
- 1mo ago Changed · +30 lines · +606 tokens per session cb3528fa99ff
- 1mo ago Changed · +9 lines · +176 tokens per session b0f6af01aa29
- 1mo ago First seen · 343 lines · 6,732 tokens per session scan A 90130fd245cb
backpass AGENTS.md is an instructions file published in the GitHub repository kunchenguid/backpass (1,471 stars, last pushed 4d ago), licensed MIT. It adds 1,911 tokens to every session, about $0.0076 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
backpass AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| backpass AGENTS.mdkunchenguid/backpass | Instructions file | 1.5k | 4d ago | MIT | A | 1,911 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |