Accordion plugin

An extension for the pi agent: shows the context as a block map and folds the surplus reversibly, with no blocking /compact

  • 247 ★ on the repository
  • Last commit
  • MIT
Plugin

Extended access

Why this level

  • The extension reads the whole session context and changes it by folding blocks
  • Conductors may call models for summaries and spend tokens in doing so
All reasons and checks

a-fig/accordion

Install

Manual install

pi install npm:@a-fig/accordion

An extension for the pi agent. Do not register it again through extensions, or it loads twice.

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The extension reads the whole session context and changes it by folding blocks
  • Conductors may call models for summaries and spend tokens in doing so

This is third-party code. Review the repository files before installing.

What it does

Accordion is an extension for the pi agent that draws the context window as a live map of colored blocks and lets you manage it by hand or through a conductor. Each block is Full, Folded (a short tagged summary) or Pinned. Folds nest: cold turns collapse into groups and groups into larger ones, so a session of thousands of turns stays compact and reversible. The most recent ~20k tokens sit in a protected tail the agent sees in full. A conductor decides what to fold, and every edit it makes follows the same rules as yours. Five conductors ship: `thermocline` scores which blocks the recent context still attends to, `triptych` replaces old file reads with tree-sitter skeletons, `doorman` shrinks huge tool results, `handoff` automatically passes the session to a fresh one and `compaction-naive` repeats the usual `/compact` as a baseline. On the SlopCodeBench test the author reports `thermocline` beating naive compaction at the same budget.

Who it is for. Developers whose long pi agent sessions hit the context window limit and lose detail after ordinary compaction.

Good fit when

  • A session of hundreds of thousands of tokens where `/compact` stalls work and loses detail
  • You want to see what fills the context: file reads, tool results or dialogue
  • You need to pin important blocks and fold the rest, restoring full text when needed
  • Inference costs are rising and you want a context without bloated tool results

Not a fit when

  • Your main agent is not pi: Accordion is built as an extension for it
  • You need a fully finished scheme with no tuning: the author marks the conductors as early
  • You need the strongest conductor from the npm package: `thermocline` and `triptych` ship only in the repository

Example request

/accordion

Limitations

The project works as a pi extension and is useless without it. The author calls the results early: the SlopCodeBench comparison is one test with one model, DeepSeek V4 Pro. The `thermocline` and `triptych` conductors run as separate processes and ship in the repository but not in the npm package, so they appear in the menu only when run from a clone. Do not register the extension twice, through `pi install` and through `extensions`: it loads twice. Building the desktop app needs Node 20 LTS and Rust.

How to disable. Remove the extension with the pi command for the `@a-fig/accordion` package or take it out of the `extensions` list. Folded blocks live in your session, and detaching a conductor converts its edits into your own.

FAQ

How do I install Accordion?

Run `pi install npm:@a-fig/accordion`. The browser version needs no Rust; the desktop app is built separately and gives the full feature set.

What is a conductor?

A strategy for choosing blocks to fold. It watches the session and proposes edits between turns, under the same rules as your manual ones.

Is folded text lost?

No, folding is reversible: a block's full text can be restored. The latest ~20k tokens are protected and stay full.

How is it different from /compact?

`/compact` makes one lossy summary of the whole history and stalls work. Accordion folds block by block in the background, ranks them by relevance and lets you restore detail.

Does it work with Claude Code?

The description names only the pi harness. The extension has not been tested with Claude Code.

Discussion

No questions or reviews yet.

Plugins

Repeated pi agent steps accumulate as JavaScript programs with a manifest and tests, and pi calls them instead of redoing work.

PluginExtended access299Repository stars

Agents Can Communicate (ACC)

Agents Can Communicate

ACC passes questions, reviews and handoffs between Claude Code, Codex and other client sessions on one machine

CLIExtended access178Repository stars

28 skills that remove instead of add: rewrite a document clean, check the read of a request, compress text and challenge a decision

SkillExtended access1.4KRepository stars

A bridge between local CLI agents: Codex, Cursor or Claude Code delegate work to Antigravity, Grok, Kimi and seven more.

MCP serverBroad access132Repository stars

A collection of 14 portable skills for long agent runs: work planning, live app QA, search across past sessions and a phone call

PluginExtended access136Repository stars

A portable .agent folder with memory, skills and protocols that plugs into many coding agents and keeps its knowledge when you switch tools

CLIBroad access2.3KRepository stars

README in short

The project description first shows the idea: the context window split into a foldable part and a protected tail. A comparison with compaction and sliding windows, the SlopCodeBench measurement, five conductors and a quick start for browser and desktop follow.

README badge

Report a problem