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 skills add a-Fig/Accordion --skill accordion-context-foldinggit 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/skills/a-fig/accordion/accordion-context-folding)<a href="https://agentmods.dev/skills/a-fig/accordion/accordion-context-folding"><img src="https://agentmods.dev/badge/skills/a-fig/accordion/accordion-context-folding/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/skills/a-fig/accordion/accordion-context-folding"><img src="https://agentmods.dev/badge/skills/a-fig/accordion/accordion-context-folding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00102 | $0.00735 |
| Opus 5 | $0.00051 | $0.00367 |
| Sonnet 5 | $0.00020 | $0.00147 |
| Haiku 4.5 | $0.00010 | $0.00073 |
Grade A, and why
accordion-context-folding 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 11d 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 — 54 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Accordion, an external desktop app, may be folding parts of your context to keep token usage within a budget. This is opt-in and controlled by the human — you cannot disable it, but you can always pull specific blocks back.
What folding looks like
A folded block appears as:
{#3f9a2c FOLDED} Assistant analyzed the test failures: three imports were missing…
The 3f9a2c is a short fold code — an opaque handle for that block. The part after FOLDED} is a short summary. The original content is preserved and retrievable — nothing is lost.
Restoring folded content
Call the unfold tool with one or more codes copied from the markers:
unfold({codes: ["3f9a2c"]})
unfold({codes: ["3f9a2c", "00a2cd"]})
(Pass the codes exactly as shown, as strings — a code may have leading zeros.)
The tool returns a confirmation. The restored content appears in your context on your next turn — not immediately. If you need the content now, call unfold and then take another step (e.g. re-read, continue the task) so the next turn picks it up.
Reading folded content right now (recall)
If you need the full content of a folded block for the current step but do not want to change your standing context, call recall instead of unfold:
recall({codes: ["3f9a2c"]})
recall({codes: ["3f9a2c", "00a2cd"]})
recall returns the block's full original content as this tool's result, immediately — like reading a file. It does not force the block open: your standing context is unchanged (the block stays folded), so it costs nothing beyond this one result.
Choose between them:
- recall — read it once, now. Content comes back as the tool result this turn; your context is untouched.
- unfold — keep it open. The block returns to your context on your next turn and stays open until the human re-folds it.
Prefer recall when you just need to glance at a value or quote; use unfold when you will keep referring to the block over several turns.
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.
- 11d ago First seen · 54 lines · 102 tokens per session scan A 50c6fd334dfd
accordion-context-folding is a skill published in the GitHub repository a-Fig/Accordion (243 stars, last pushed 19d ago), licensed MIT. It adds 102 tokens to every session and 735 once invoked, about $0.0005 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 skills, from other repositories
codebase-memory
Use the codebase knowledge graph for structural code queries. Triggers on: explore the codebase, understand the architecture, what functions exist, show me the structure, who calls this function, what does X call, trace the call chain, find callers of, show dependencies, impact analysis, dead code, unused functions…
memory-compounding
Review and sharpen persistent memory so it compounds instead of accumulating. Use when pruning pi-hermes-memory entries, doing monthly memory hygiene, or when the same lesson has been recorded multiple times.
session-handoff
Hand off work to another Pi session — write a handoff doc, save key decisions to memory, and notify the target session via intercom. Use when a session is getting long, when you need to continue work in a fresh context, or when transferring work between projects/sessions. Composes handoff.ts (doc writer) + memory…
aha
Capture aha-moments as durable insight notes under .ai/insight/, or quiz the user on past insights to reinforce recall. Use when the user has just learnt something non-obvious (a fix they didn't know, an explanation that clicked, a gotcha discovered) and wants to record it, or when the user invokes /aha quiz to be…
persist
Store your findings, analysis, or other outcomes on disk for future reference. Use when user asks you to do something that does not explicitly mention planning but clearly does not involve taking action yet e.g. analysing or investigating something.
session-search
Search and verify Joel's Pi, Claude, Codex, Cursor, Grok, and OpenCode session history. Use when asked to recover prior context, find exact transcript evidence, inspect session receipts, continue old work, or verify capture health. Prefer flowing recall before raw transcript search when the question is about prior…