No compaction
When a task fills its context window, pi opens a fresh one with a short handoff instead of a summary; here is where that line sits, what crosses it and what it costs.
At a glance
- With fresh context windows on, the default, no model summarizes your conversation. pi opens a new window with a short handoff.
- On a 1,000,000-token window the line sits at 983,617 tokens, and a reminder to save notes can come 32,000 tokens earlier.
- Fresh windows, notes and history work on every plan with no mux account. Clef's extras need Pro, Pro+, a trial or your own key.
- A summary of a full window costs up to $3.80 on Opus 5.5 and $9.50 on Fable 5.1 before output. A fresh window makes no extra call.
With fresh context windows on, the default, muxcode doesn’t compact: no model summarizes your conversation to free room. A context window is everything the model reads on one request. When one fills, pi, the open-source coding agent muxcode runs, opens a new one.
The new window holds the system prompt, the tools and a handoff, a short record carrying the task over. The rest stays where the task runs, on your Mac or, for a sandbox task, with its agent on mux, in notes and an append-only history the model reads back. We adapted this from Posthorse, an open-source pi extension.
Why not compact
Compaction spends a large model call and loses detail. When a window fills, the agent asks a model to write a summary of the conversation, and the next window starts from that summary. What the summary leaves out is gone from the model’s view.
A fresh window makes no call. pi starts the next window from a short handoff, and the model reads back anything else it needs.
Summary compaction
Fresh context window, the default
Where the line sits
A window rolls over once it passes its size minus 16,384 tokens, which pi reserves for a summary. That’s pi’s own compaction line; muxcode leaves it there unless you set a Window cap, below.
A checkpoint reminder, a prompt to save notes and roll over, comes up to 32,000 tokens earlier.
From muxcode 1.0.19, the guidance in every request on your Mac names the line in tokens beside its share of the window, such as “98% used, 983,617 of this model’s 1,000,000 tokens”. It tells the model to look up what is left before it says how much room remains or changes plans because of it, and never to guess.
A 1,000,000-token window Window cap choices on top
The last 100,000 tokens, enlarged no cap set
The reserve is the same on every model, so a smaller window rolls over at a smaller share of its size.
Opus 5.5, Fable 5.1 1,000,000-token window
reminder 951,617 rollover 983,617 (98%)
GPT-6 Luna 272,000-token window
reminder 230,056 rollover 255,617 (94%)
pi also rolls over on a “too long” error, or when the model asks. The reminder comes at most once per window, and one huge turn can jump the line. A final answer gets no reminder unless a message is queued behind it, since the run then goes on anyway. From muxcode 1.0.19, a reply cut off at the model’s output limit gets none either: pi recovers it on its own.
The Window cap
The Context windows card in Settings → Models holds a Window cap: Off, 256K, 400K or 600K. On a model with a larger window, such as Opus 5.5 at 1,000,000 tokens, a fresh window then starts before a request reaches that size, and pi still keeps its 16,384-token reserve under the cap. The cap applies to new tasks on your Mac while windows are on.
What crosses the line
When pi rolls over on its own, the handoff records inputs, not progress. It names the task, its notes and where its history lives, and quotes your requests, your latest answer and any tool results no reply followed.
Handoff inputs, not progress
- the task, its previous window and where its history lives
- the names and revisions of its notes · up to 20, newest first
- your first and latest requests, your latest answer and the latest input
- the last tool results, if no reply followed · 1,500 characters each
- the previous handoff, marked possibly stale, or a pointer if automatic
Older inputs are listed, not quoted: one line each, with the first 120 characters of anything you wrote, newest first when room runs short. The model’s own handoff, when it asks for a new window, has the same 20,000-character limit.
When the usual record won’t fit, a minimal handoff carries pointers to notes and history, plus as much of your latest request as fits.
Reading back
The model reads back through two tools. A notes tool keeps the task’s notes, every revision readable. A history tool searches this branch of the conversation, the whole task or, on your Mac, up to 200 recent project sessions. It matches plain text, not meaning.
Each read returns one page, sized to the room left in the window and at most 40,000 characters.
notes the task's notes
every revision stays readable
history the conversation, append-only
matches plain text, not meaning
What should outlive the task goes to workspace memory. Once your workspace is connected to mux, a workspace_memory tool keeps a shared repo for the workspace and a private one for you. Each edit is a Git commit, and your old project notes are copied into the private one.
Memory works on every plan, with windows on or off; search by meaning in it needs Pro, Pro+ or a trial, and Hobby matches words. Without a mux connection, project notes stay on your Mac.
Recovery
A rollover keeps the old window. History is append-only, so the earlier conversation stays saved, and the transcript marks the boundary with a “New context window” divider. Open it to see what started the window and its token count before and after.
When the model asks for a fresh window, pi starts one only if every tool call in that batch succeeds. If any call fails, the request does nothing.
Which plans
Fresh windows need no plan and no mux account: pi runs them on your Mac, so Hobby gets them too, with notes, history and the handoff.
Clef adds to them. It runs on Pro, Pro+ or a 72-hour Pro trial, through mux, or with your own Cloudflare API token and account ID.
| What you get | Hobby | Pro | Pro+ | Pro trial72 hours |
|---|---|---|---|---|
| On your Mac, with no mux account | ||||
| Fresh windows, notes, history, handoff | yes | yes | yes | yes |
| Clef, through mux or your own key | ||||
| Clef in the handoff and reminder | own key | yes | yes | yes |
| Clef input tokens a daythrough mux | 0 | 280,000 | 2,800,000 | 280,000 |
| per five hoursthrough mux | 0 | 100,000 | 1,000,000 | 100,000 |
| On mux | ||||
| Windows for sandbox tasks | no sandbox | yes | yes | yes |
What Clef adds
Clef, the classifier (Cloudflare’s decision model, run as @cf/cloudflare/clef on Workers AI since muxcode 1.0.12, and as clef-flash before), answers muxcode’s questions with a probability.
For a task on your Mac, the handoff then quotes first the older inputs Clef reads as most needed, in up to half the room left, and carries up to six 600-character excerpts of tool results it reads as still needed. There, if Clef reads a turn as a clean stopping point, the reminder can come up to 32,000 tokens sooner.
No more bloat than compaction
A window grows exactly as far with fresh windows as with compaction.
pi’s built-in tools cap each result at 50 KB; an extension’s tools may not. Without Pro, Pro+, a trial or your own key, muxcode takes nothing back out before the line. With any of them, muxcode trims two things on Clef’s reading:
- stretches Clef reads as unrelated in a command or search result of 12,000 characters or more, keeping head and tail. History keeps none of the cut text; the model reruns a narrower command. A sandbox task gets this trim too, while your Mac is attached.
- in a task on your Mac, older results of 800 characters or more that Clef reads as no longer needed, from 919,617 tokens on a 1,000,000-token window. Each becomes a pointer into history, for one cache miss in all.
In a sandbox
A sandbox task needs Pro, Pro+ or a trial. It keeps its windows on mux, with its agent, and follows your Fresh context windows switch. It rolls over 16,384 tokens short of the window, gets the same reminder and caps each handoff at 20,000 characters, with the same per-record limits. The window is the model’s full size: the Window cap stays on your Mac.
The windows there make no Clef call, so the handoff lists older inputs and quotes none, carries no excerpts, and the reminder never comes early for a clean stopping point; no older result leaves the model’s view. History searches that task alone. While your Mac is attached, muxcode still trims the task’s large command and search results, as above.
Turning windows off
With Fresh context windows off (Settings → Models → Context windows), the task’s own model summarizes older conversation at the same line, keeping about the newest 20,000 tokens verbatim. New tasks use the switch at once; open tasks need an app restart. Notes and history saved before stay readable.
A task started with windows off has no notes or history tools to read back what the summary drops. While windows are on, muxcode refuses a manual compact, a summary you ask for.
What it costs
A fresh window makes no extra call to your model; a summary makes one large call, two if the cut splits a turn. Inside a window the prompt only grows at its end, so the provider’s prompt cache serves earlier tokens cheaply. At pi’s catalog API prices, that’s $0.20 per million tokens on Opus 5.5 and $0.25 on Fable 5.1, against $4 and $10 uncached.
A summary can’t reuse that cache: pi rewrites the conversation as text under its own prompt, uncached, with each tool result cut to 2,000 characters. On a full window that’s at most about 950,000 tokens: $3.80 on Opus 5.5 and $9.50 on Fable 5.1, before output. We haven’t measured a typical one.
- One summary of a full Opus 5.5 window, at most
- $3.80 before output
- One summary of a full Fable 5.1 window, at most
- $9.50 before output
A fresh GPT-6 Luna window opened at an estimated 13,400 tokens in our QA on 2026-09-25.
Louis-François Bouchard found full history cheaper than summarizing while cached input costs under about $0.55 per million tokens, as both prices above do. At $0.50, the two roughly tied. On Gemini 3.5 Flash, full history also recalled more: 92% against 38% for a summarizing preset.
Reading back costs calls. At 5× compression, Shuyu Liu found GPT-5.5’s retrieval calls tripled, 21.0 to 63.9, while completion’s rise from 80% to 85% wasn’t significant. Fresh windows drop more, so we expect more reading back; we haven’t measured it.
The case against
Several teams now build long threads around compaction. OpenAI trained GPT-5.1-Codex-Max for it. Cursor trained Composer to summarize itself, halving compaction errors with summaries a fifth as long. Amp swapped its handoff for automatic compaction at 90% full.
At Anthropic, Prithvi Rajasekaran used resets because Sonnet 4.5 had “context anxiety”: it wrapped up early near its limit. Opus 4.5 largely stopped that, so he dropped resets for automatic compaction.
The working where each number comes from
- pi 0.87.1 defaults, unchanged in muxcode 0.12.7: 16,384 and 20,000 tokens, 2,000 characters, 50 KB. muxcode 1.0.5 runs pi 0.99.2; there we re-read only the 16,384 reserve. muxcode 1.0.6 runs pi 1.0.4, read on 2026-10-06: all four defaults, and the windows and prices above, are unchanged. muxcode 1.0.19 runs pi 1.4.0, read on 2026-10-28: the four defaults are unchanged; we did not re-read the windows or prices. Windows and prices: pi’s catalog, unchecked with providers.
- muxcode 0.12.7, read on 2026-09-28, and muxcode 1.0.5, read on 2026-10-06: the character limits, six excerpts, 200 sessions and every token threshold. Rollover is window minus reserve, plus one.
- Reminder: the rollover line less 32,000 tokens or a tenth of the window less the reserve, whichever is smaller. That gives 951,617 and 230,056; the figures compute both from the window size.
- The line in tokens, and no reminder after a cut-off reply or a final answer with nothing queued: taken from Posthorse 0.10.0 in muxcode 1.0.19’s
context.ts, andCHANGELOG/1.095.md, read on 2026-10-28. The share is rounded: 983,617 is 98.4% of 1,000,000. - muxcode source at 1.0.6, read on 2026-10-07: a page of at most 40,000 characters, up to 20 notes named in a handoff, a requested window only after the whole tool batch succeeds, and the divider’s trigger and before-and-after token counts.
- Window cap: 262,144, 409,600 and 614,400 tokens, from muxcode 1.0.5. The window figures above assume no cap.
- Clef meters:
PLAN_METERSin mux’s plan types, read on 2026-10-07: input tokens a day and per five hours; a trial lasts 72 hours with Pro’s meters. Hobby has no sandbox (PLAN_LIMITS, same date). - Sandbox windows: mux’s cloud agent, read on 2026-10-06. Rollover is window minus reserve, or half the window if that is more.
- 13,400 tokens: estimated at four characters a token.
- $3.80 and $9.50: a ceiling, 950,000 tokens (983,617 less the 20,000 kept and the prompt) at $4 and $10 per million tokens.
- The shares of a window in the first and handoff figures are sketches, not measurements.
- Dates: OpenAI Nov 19, 2025; Cursor Mar 17, Anthropic Mar 24, Amp May 6, Liu Aug 17 and Bouchard Aug 18, 2026.