Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/a-fig/accordion/claude-mdgit clone --depth 1 https://github.com/a-Fig/AccordionWrote 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/a-fig/accordion/claude-md)<a href="https://agentmods.dev/instructions/a-fig/accordion/claude-md"><img src="https://agentmods.dev/badge/instructions/a-fig/accordion/claude-md.svg" alt="Measured on agentmods" 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.13772 | $0.13772 |
| Opus 5 | $0.06886 | $0.06886 |
| Sonnet 5 | $0.02754 | $0.02754 |
| Haiku 4.5 | $0.01377 | $0.01377 |
Grade A, and why
Accordion CLAUDE.md scanned grade A with 0 findings 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 321 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md — Accordion
Guidance for AI coding sessions. VISION.md = product north star · README.md = short pitch.
Key URLs
- Marketing site: https://get-accordion.dev/
- Public repo: https://github.com/a-Fig/Accordion
Terminology
- pi — the CLI AI coding harness whose context window Accordion visualizes. Not an Accordion product; it's the tool the user runs.
extension/accordion.tsis a pi plugin that hooks into pi'scontexthook (fires before each model call). - block — atomic unit of context: one chunk of a single kind (
system,user,text,thinking,tool_call, ortool_result). Seecore/types.ts → Block(app/src/lib/engine/types.tsis a re-export shim). - bolted — a block no actor may fold, group, pin, or replace: not the human, not a conductor, not the agent. Today exactly the
systemkind (the harness's own prompt,SYSTEM_BLOCK_ID = "sys:0", always the FIRST block,order-1). Predicate:core/digest.ts → isBolted; refusals surface as the"bolted"ClampReason, checked FIRST in every op handler so a conductor learns the PERMANENT reason rather than a misleading incidental one. Distinct from held (a human override the human can release) and from protected (the working tail, which moves as the tail resizes) — bolted is a property of the kind and never lifts. Its tokens ARE counted inliveTokens/fullTokens: a fixed floor, not reclaimable headroom. If no prompt can be sourced, NO block appears at all (silent absence, never a placeholder). - turn — one user message plus all assistant content (thinking, text, tool calls, tool results) that follows it before the next user message.
- fold / folding — replacing a block's content in-place with something shorter, like a summary; the block stays on the wire to the LLM in compressed form. Always reversible.
- Truth —
core/truth.ts'sTruthclass: the canonical, framework-free context state — block log, per-block overlay (override/autoFolded/subst/by), multiblock groups, the protected working tail, involvement locks, budget/context-window dials, and a monotonicrevthat bumps on every change and rides every emittedTruthEvent. One instance lives authoritatively inside the pi extension per live session (ADR 0021); the app's Svelte store and any conductor are thin mirrors over it, never a second source of truth. - replica — a
Truthhydrated from a host'ssnapshot(core/replica.ts → hydrateSnapshot) and kept in lockstep by replayingWireEvents; it asserts itsrevmatches the host's after every replay and requests a freshsnapshoton any mismatch rather than patching around a gap. The GUI is always a replica in live mode; a spawned conductor is a replica too (core/conductor/remote.ts). - held — a block carrying a human override (manual pin, fold, or unfold): a non-null
Block.override. Held state always wins over a strategy's proposed ops — the one exception is an involvement lock: while a conductor holdshuman-steering, the human steering mutators are refused outright (no override is ever created) until the lock releases or the conductor is detached (see freeze, below, and the Conductors section). - conductor — a pluggable, evented context-management strategy (
core/conductor/contract.ts's frozen v2Conductorinterface) that attaches to a host, subscribes toHostEvents (blocks-appended/turn-committed/state-changed/wire-departing/resync), and proposes diff-op transactions between turns rather than being polled every pass. Never a privileged write path — every proposed op is clamped by the exact sameTruth.applya human hand action or the agent's own tools go through. Five ship today:compaction-naive,handoff,doorman(in-process, bundled into the extension) andthermocline+triptych(out-of-process, each spawned as its own Node process). See the Conductors section. - transaction / propose — a conductor's unit of write:
host.propose({ baseRev, ops }): Promise<TxnResult>(core/conductor/contract.ts). Async by contract — an in-process host applies the ops synchronously and resolves on a microtask; an out-of-process host resolves after apropose/proposeResultwire round trip. A conductor cannot tell the two hosts apart, which is the whole portability point. - birth-fold — the exemption (ADR 0018, restored as ADR 0023) letting a strategy fold a block that sits inside the protected tail but has never yet reached the model whole (
Truth.canFold'sif (this.isProtected(b)) return !this.sent(b)branch). Such a fold is tracked inTruth's stickybirthFoldedset so the tail growing over it later doesn't heal it back open.doormanis the shipped demonstration — it skeletonizes or folds a giant freshtool_resultbefore it ever rides the wire. - hold /
holdWireUpToMs— a conductor may declareholdWireUpToMs(ms, default 0) to ask the host to pause the departing wire briefly on thewire-departingevent, giving it one last chance toproposea last-moment fold before the model call actually leaves. The hold ends when the conductor's wire-departing handler settles — in-process, the returned promise resolving/rejecting; a remote conductor sends a dedicatedholdRelease { holdId }the instant its handler settles (protocol v14; the host correlates by theholdIdit minted per hold and ignores a stale/unknown one). Aproposenever releases the hold, so a concurrent background-tick propose (e.g. thermocline's prepare epoch) can't race it out from under the handler. Bounded: a timeout releases the wire unchanged and counts againstholdTimeouts. Surfaced live asMapHeader's HOLD chip and in telemetry'slastHoldMs/holdTimeouts. - freeze — the conductor-detach kill switch (
{ kind: "freeze" },core/ops.ts): converts every currently strategy-owned fold/group into a human-owned one (the substituted content preserved byte-identical) BEFORE the host releases the conductor's locks, so work an exclusive conductor did survives its own detach instead of reverting or vanishing. - the wire — the messages array sent to the LLM provider. "Wire-valid" = the outgoing array is well-formed. Distinct from the WebSocket between the app and the pi extension (that's the live link / accordion protocol).
- browser-served — mode where the pi extension HTTP-serves the SvelteKit UI on the same ephemeral port as the WS. Multi-session-aware (the served extension lists every live session over
/__accordion/sessions); no Tauri desktop app required. - CC — Claude Code (as in "CC transcript", "CC browsing"). Read-only mode; sessions loaded from
~/.claude/projects/. - controller / lease — the global, machine-wide right to send mutating steering commands (ADR 0024, issue #66). Exactly one surface (a desktop app instance, a browser tab) holds it at a time, tracked as a
ControllerLeaseblackboard at~/.accordion/controller.json(app/src/lib/live/registry.ts); every other connected surface is a live, strictly zero-write READ-ONLY mirror. Claiming (claimController) is silent when uncontested and never refused when contested — the human is always the authority, last write wins. Enforced at the extension's WScommandingress (a synthesized"read-only"ClampReason, never produced byTruth.applyitself), so conductorproposeand the agent's ownunfold/recallare completely unaffected. - door / surface — the door is the fixed, well-known loopback port (
DOOR_PORT = 24317,core/protocol.ts) exactly one extension binds at a time, as an additional listener alongside its own per-session ephemeral server, so/accordioncan print one stable URL that survives any single session's death (first-bind-wins, automatic takeover on the holder's exit). A surface is a connecting client's per-tab identity (asessionStorageUUID — per tab, not per origin, with a duplicate-tab BroadcastChannel dedupe guard; seeapp/src/lib/live/surfaceId.ts— plus a human label like "Desktop app"/"Browser tab") — what the controller lease is actually granted to. - READ-ONLY — the one term for "this view cannot write," covering two distinct situations: a Claude Code transcript (plain badge, no wire, no escape) and a live session currently steered from another surface (
READ-ONLY · <WHO> STEERSchip + aTAKE CONTROLbutton). Both share the exact same guarantee (see the RULE below); "view-only" is deliberately never used as a second term for either.
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 First seen · 321 lines · 13,772 tokens per session scan A e71630f772a0
Accordion CLAUDE.md is an instructions file published in the GitHub repository a-Fig/Accordion (238 stars, last pushed 14d ago), licensed MIT. It adds 13,772 tokens to every session, about $0.0689 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
pine-of-glass AGENTS.md
Instructions for tmustier/pine-of-glass, covering pine-of-glass: agent notes, commands, layout & rules, style and releasing.
pi-extensions AGENTS.md
AGENTS.md instructions for narumiruna/pi-extensions, covering repository guidelines, documentation and communication, repository structure, commands and tooling and dependency safety.
squeez CLAUDE.md
Claude Code instructions for claudioemmanuel/squeez, covering claude.md, commands, hard constraints, architecture and key files.
pi-extensions AGENTS.md
AGENTS.md instructions for MattDevy/pi-extensions, covering pi-extensions, repository structure, commands (run from repo root), working on a specific package and readme conventions.
pi-extensions CLAUDE.md
Claude Code instructions for MattDevy/pi-extensions, covering claude.md, commands, architecture, data flow and key modules.
my-pi AGENTS.md
AGENTS.md instructions for spences10/my-pi, covering agents.md, orientation, repository-specific skills, source of truth order and commit and changeset ownership.