backpass: Instructions file for Codex

AGENTS.md

backpass AGENTS.md is an instructions file for Codex, OpenCode from kunchenguid/backpass. It costs 1,911 tokens per session, scanned A, original, MIT.

Project memory instructions for backpass, an npm command-line tool that reviews earlier agent sessions and proposes evidence-based updates to AGENTS.md or CLAUDE.md files.

In plain words
What is it for?
They are for orienting agents in the repository, tracing the analysis pipeline, and maintaining project instructions based on past work.
Why use it?
They help coding agents understand the project’s governing documents, processing stages, and rules before changing the tool.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md; mentions Cursor.

This is kunchenguid/backpass's own configuration. It tells Codex and OpenCode how to work on backpass itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything backpass configures →

About the project

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.

kunchenguid/backpass · 1,471 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/kunchenguid/backpass/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/kunchenguid/backpass

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for backpass AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/kunchenguid/backpass/agents-md/github.svg)](https://agentmods.dev/instructions/kunchenguid/backpass/agents-md)
Your own site
<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.

agentmods 80×15 button for backpass AGENTS.md

Your own site · 80×15
<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>
Per session 1,911 This file is loaded in full into every session.
When invoked 1,911 The same file — it is already loaded in full.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 6d ago against content hash 5de4e3cebd34, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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
AGENTS.md · 93 lines

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.md is the acceptance policy; run its closing accept/resist test against VISION.md alone.
  • README.md documents the user-facing surface and how each stage works; src/cli.js is 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_LABELS in src/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 check runs lint, format:check, typecheck, and offline tests (fixtures under test/fixtures/).
  • Releases are release-please; never hand-edit CHANGELOG.md or .release-please-manifest.json.
  • .github/workflows/no-mistakes-required.yml calls the upstream require-no-mistakes action pinned to a commit SHA (never @main); change enforcement upstream, bump the pin in a separate PR, and push through git push no-mistakes (see CONTRIBUTING.md).

Hard invariants

Each owning file's comments and tests hold the detail; read them before touching the area.

  • Only src/apply/writer.js writes 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 pass approveAll with the repo as cwd; staging and the fingerprint stay in step except skillSearchPaths skills are withheld but fingerprinted: a direct write fails assertRepoUntouched (src/synthesize.js). Keep that protection. The model never supplies find text; 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 by src/commands/usage.js.
  • Evidence floors live in buildProposal (src/proposal.js): every non-extract/move edit needs minGapEvidence distinct sessions from summary.sources; deletions need harm-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 a buildProposal gate.
  • Quotes must be found in the trace they cite (sanitizeEvidence in src/analyze.js), so fake agents in tests must quote real session text. Bump ANALYSIS_INDEX_VERSION (src/state.js) for any change to what analysis accepts.
  • Sampling is deterministic and sticky (src/sample.js): a per-transcript hash of transcriptIdentity and config.seed, never Math.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.js drops 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 (foldForRun in src/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). --target accepts 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.js is the only ssh spawn boundary; nothing installs remotely and the probe bundle must stay self-contained (PROBE_MANIFEST); discovery.hosts in a repo's .backpassrc.json is 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 ingests cli/acp, plus tui only with an absolute cwd (see its header).
  • Skills (src/skills.js): a bare skills/ dir is never auto-detected; writes never target skillSearchPaths; search-path and out-of-repo skills are withheld from staging (src/workspace.js).
  • Memory resolution is pointer-aware (resolveMemoryFiles in src/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 through src/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 ACP set model or Pi set 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 with extractUrl, 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 measured gapIds or instructionIds overlap, 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.

Read the full file on GitHub · 93 lines

Changes

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.

  1. 6d ago Changed · +4 tokens per session 5de4e3cebd34
  2. 1mo ago Changed · +17 tokens per session 4357bae9c495
  3. 1mo ago Changed · +3 lines · +72 tokens per session 6e8a0d7554bb
  4. 1mo ago Changed · +8 tokens per session b6c06526f77d
  5. 1mo ago Changed · -317 lines · -6,201 tokens per session d1028f462ecf
  6. 1mo ago Changed · +13 lines · +249 tokens per session b779641a2bea
  7. 1mo ago Changed · +12 lines · +248 tokens per session 8d20a2bdc0ab
  8. 1mo ago Changed · +30 lines · +606 tokens per session cb3528fa99ff
  9. 1mo ago Changed · +9 lines · +176 tokens per session b0f6af01aa29
  10. 1mo ago First seen · 343 lines · 6,732 tokens per session scan A 90130fd245cb

Subscribe to this mod's changes

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.

Related

backpass AGENTS.md compared with instructions from other repositories

backpass AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
backpass AGENTS.mdkunchenguid/backpassInstructions file1.5k4d agoMITA1,911Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode