Borrowing it
Nothing to install: this file belongs to a-Fig/Accordion. 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/a-Fig/Accordion/main/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/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/a-fig/accordion/claude-md"><img src="https://agentmods.dev/badge/instructions/a-fig/accordion/claude-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.14500 | $0.14500 |
| Opus 5.5 | $0.05800 | $0.05800 |
| Sonnet 5.5 | $0.02900 | $0.02900 |
| Haiku 4.5 | $0.01450 | $0.01450 |
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 1mo 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 — 324 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.
- authored digest — a folded block's digest, or a folded group's summary, written by the HUMAN instead of the engine (
foldop'sdigest,groupop'ssummary; UI:app/src/lib/ui/map/DigestEditor.svelte). Stored verbatim inBlock.subst/Group.digestand — the load-bearing part — untagged. See the tag is the handle. Clearing the editor means different things at the two granularities, deliberately: a BLOCK commits theEMPTY_DIGESTsentinel{empty}(~6 tok — per-block folding is content substitution, andapplyPlandrops an emptydigestText, which would ship the block WHOLE), while a GROUP commits a real DROP (Group.digest === null; a group may legally change the wire's message count, subject to the tool-pair fixpoint and role-validity floor). Saving with no text at all restores the engine's own digest/recap, tag included. - the tag is the handle — the
{#<code> FOLDED}prefix is the ONLY way a fold code ever reaches the model, so whether the wire text carries that block's OWN tag decides whether the agent can reach it at all (core/digest.ts → hasOwnFoldTag; enforced incore/agentView.ts'sagentReachable/groupAgentReachable). Own-tag, not any-tag: a foreign tag — pasted by a human, hand-authored by a conductor — must not make a block reachable by its own code, which is the accidental-restore path the rule exists to close. Engine digests, default group recaps, and a conductor's recoverablereplacecarry their own tag and are thereforeunfold/recall-able; a HUMAN-authored digest and a conductor'srecoverable: falsereplace are untagged and unreachable — a human's own words are not something the agent may undo. To keep that true, the HUMAN branches of BOTHTruth.opFoldandTruth.opGroupstrip leading tags (stripFoldTags, to a fixed point) exactly asopReplacedoes — the engine is the sole author of the tag. This is enforced inTruth, not in the editor, deliberately: the editor seeds its box with the current digest/recap, so edited engine text still starts with a tag, andsanitizeOpspasses a rawfold.digest/group.summarythrough untouched — a widget-only strip would leave the invariant resting on a Svelte component. The strategy branches deliberately do not strip —ViewConductoremits fold-with-digest and a conductor authoring its own recall handle is a supported shape. The one carve-out is a DROP group: it emits no text, but stays reachable because the role-validity floor may degrade it to aroleFloorRecapstub carryingfoldTag(g.id)on purpose. - 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.
- 1mo ago Changed · +3 lines · +728 tokens per session cf2852618e0b
- 1mo 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 (247 stars, last pushed 28d ago), licensed MIT. It adds 14,500 tokens to every session, about $0.0580 per session on Opus 5.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
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
vscode model-prompts.instructions.md
Model-specific prompt authoring and registry guidelines.