Repository navigation
agent pane: the Context card and the context ring show Claude Code's /context breakdown - #24303
Conversation
…/context breakdown Leo: "i feel like having a teensy bit more of the card type thing with fuller info in the session sidebar would be nice? like just make our context circle have a bit more stuff" The Inspector's Context and the composer context ring's details draw a Claude Code chat's /context (acpmux contextBreakdown): the bar split by category in steps of the theme accent, a row per category with tokens and share (deferred ones dimmed with no share, free space last), and MCP tools, Memory files and Skills folds that list their items. Without a breakdown both keep what they drew before. Carries the contextBreakdown plumbing of #24223 (model.ts, direct.ts) unchanged, so either lands first. Leo-ask: ask-af4ecbf18f Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16037-16c2-7a73-b063-2e37ed40b9c4&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Gallery before/after for
States
Pick other states with a Passes: CI passes on CI passes on Written by red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 77873a0 to compare; do not merge until green; see lane-rules Tour of |
direct.ts, model.ts and the session-start test now match #24223 at 2ac8840 (its review fixes): an info update keeps its title and Claude Code's facts when it also carries the breakdown, and the update's breakdown goes through contextBreakdownOf. reconnectMcp stays with #24223. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16037-16c2-7a73-b063-2e37ed40b9c4&host=cosmic-gray
|
Bead |
|
Found 11 test failures on Blacksmith runners: Failures
...and 1 more test failures. View all on Blacksmith
|
The breakdown's bar read --acpmux-context-free, which only the Inspector's Context wrapper set, so in the composer ring's details the track was transparent. The breakdown sets it itself (Codex review P2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16037-16c2-7a73-b063-2e37ed40b9c4&host=cosmic-gray
|
Review (codex xhigh, correctness first): SHIP at b9261c5 Reviewer: Codex (gpt, xhigh) via acpmux on big-red, read-only, static review of the full PR diff.
|
|
Shipped in:
|
|
Shipped in:
|
After each Claude Code turn acpmux asks get_context_usage and sends the trimmed answer as session_info_update _meta.acpmux.contextBreakdown, kept in the session detail's contextBreakdown (the shape #24303's Context card reads). A failover or a replaced agent's late answer drops or ignores it. _acpmux/mcp/reconnect sends Claude Code's mcp_reconnect for a server the chat lists; the agent pane may relay it for a chat in its scope. Rebased onto feat-cmux-next as one commit: the web plumbing #24303 already landed is not repeated; this carries the daemon side, reconnectMcp and the pane's failover drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red
* acpmux: Claude Code's /context breakdown and MCP reconnect After each Claude Code turn acpmux asks get_context_usage and sends the trimmed answer as session_info_update _meta.acpmux.contextBreakdown, kept in the session detail's contextBreakdown (the shape #24303's Context card reads). A failover or a replaced agent's late answer drops or ignores it. _acpmux/mcp/reconnect sends Claude Code's mcp_reconnect for a server the chat lists; the agent pane may relay it for a chat in its scope. Rebased onto feat-cmux-next as one commit: the web plumbing #24303 already landed is not repeated; this carries the daemon side, reconnectMcp and the pane's failover drop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red * acpmux: rustfmt the context and reconnect lines Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16c8c-54ec-71b2-a0fa-125d1404dd72&host=big-red --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
The Inspector's Context card and the composer context ring's details now show what fills a Claude Code chat's context window, not just used and free. Leo asked:
and earlier, for the Inspector: "every item must do something on click".
Leo-ask: ask-af4ecbf18f
What changes
When acpmux reports Claude Code's
/context(summary.contextBreakdown, added by #24223), both surfaces draw the same card (ContextBreakdownViewininspector/ContextSection.tsx):Colors come from the theme. Each used category is a step of
var(--agent-accent)mixed toward transparent, largest first. The buffer and deferred categories are tints of the text color. Nothing is orange or opaque, and the ring popover keeps its glass.Without a breakdown (Codex, other harnesses, or a Claude Code too old to answer), the Inspector keeps its used/free rows and the ring keeps its old popover content (bar, tokens, setup/conversation parts). The ring stays where it was; only its popover's content changes.
contextBreakdown()validates defensively. It returns nothing for a non-object, for nomaxTokensor for nocategoriesarray. It drops categories that lack a name or a known kind, clamps negative or non-numeric counts to 0 and caps shares at 1. It also drops malformed MCP tool, memory file and skill rows.This PR carries #24223's webview plumbing at its reviewed head 2ac8840 (
AcpmuxContextBreakdowninmodel.ts;direct.tsreadingcontextBreakdownthroughcontextBreakdownOf, keeping the rest of a combined info update; and its session-start test), byte-identical exceptreconnectMcp, so it doesn't wait on #24223's Rust side. Whichever lands second merges cleanly.Gallery
Three Inspector variants. Only the first ships; the other two are gallery fixtures, not settings:
agent-pane.chat-inspector / context-breakdown(shipped): accent steps, largest first. It reads as one color family on the glass, like the rest of the panel, and the bar still shows the parts apart.context-breakdown-hues: each category a hue rotated from the accent, the closest to Claude Code desktop's palette. It reads faster, but it brings colors the theme doesn't have.context-breakdown-mono: every category in the full accent. It's the quietest, but the bar no longer says which part is which.Ring popover:
agent-pane.context-ring / breakdownandbreakdown-memory-open.Not in this PR
Account usage limits (session and weekly percentages with reset times) need acpmux to send
usageLimits, which a sibling lane is adding. They'll come in a follow-up PR on top of this card.Size: the diff is about 1,060 lines. 396 of those are the three new strings' 21-locale catalog entries, and about 70 are #24223's plumbing and test.
Observed / Not run
scripts/web-lint.sh(Oxlint, Oxfmt, type check, layer checks, catalog keys) passed, andscripts/cmux-next/prepush-gate.pyreported no new violations.bun test. The newwebviews/test/chat-inspector-context-breakdown.test.tsxcovers the ordering, shares, dropping of malformed input, MCP name shortening, the folds opening and closing on click, the Inspector fallback without a breakdown, and the ring popover with and without one. It runs in this PR's CI. Gallery captures come from the gallery advisory run.Changelog
🤖 Generated with Claude Code
Agent session: cosmic-gray