Show per-agent context size in tree (closes #16)#17
Merged
Conversation
Display each Main/subagent's current context as a percentage of the model's max context window (e.g. `Main 18%`, `Explore 9%`). Context size = latest assistant message's input + cache_creation + cache_read tokens (a rolling snapshot, not a cumulative sum). Denominator is the *model's max context window* — NOT the user's autoCompactWindow setting. Hardcoded table: - claude-opus-4-7 → 1,000,000 - claude-sonnet-4-6 → 1,000,000 - claude-haiku-4-5 → 200,000 Per-subagent model is read from the per-message `model` field in the subagent's JSONL, so a haiku subagent under an opus Main shows its own (200k) denominator. Also drops the redundant ☑/☐ checkbox column; disabled rows are now indicated by muted styling on the existing emoji status icon. Closes #16 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 2, 2026
phiat
added a commit
that referenced
this pull request
May 2, 2026
Mirrors the tree-row checkbox removal from #17. Disabled toggles get a leading mid-dot (·Thinking[t]); enabled toggles a leading space ( Thinking[t]) so the bar's column widths stay aligned. Verified live with tui-use against an active session. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #16 — thanks @halfbusy for the feature request!
Surfaces the current context size for Main and each subagent inline in the tree.
input + cache_creation + cache_readper (session, agent) — overwrite, not sum, since context size is a rolling snapshotMain 18%,Explore 9%)autoCompactWindowsetting. Resolved from per-messagemodelvia a per-family table:claude-opus-4-7,claude-sonnet-4-6→ 1,000,000claude-haiku-4-5→ 200,000parser.ContextWindowForas new models shipmodelfield in the subagent JSONL — a haiku Explore under an opus Main shows/200kVerified live
Tested with
tui-useagainst multiple concurrent sessions, including a haiku-backed Explore subagent under an opus Main — Main row showedMain 18%(180k of 1M) while the haiku Explore showedExplore 9%(its own 200k denominator).Test plan
go test ./...passesclaude-espagainst a live session — verifyXX%appears on the active Main row after the next assistant turnspace— verify the muted styling is visible without a checkbox🤖 Generated with Claude Code