[FEATURE] surface live context % in claude agents pane (statusLine / hook)
Preflight Checklist
- [x] Searched existing requests — none match
- [x] Single feature request
Problem Statement
i use a custom statusLine command that writes per-pane ctx% / 5h% / 7d% to a sidecar file, and a tmux HUD reads from it. its the single most useful signal i have for catching compaction risk during long sessions before it fires.
works fine for normal claude invocations. but theres no path to get the same data inside a claude agents pane:
- statusLine never fires for the pane (neither for the orchestrator picker nor when a sub-chat is focused)
- the focused sub-chats are backgrounded by the daemon (
claude --bg-pty-host/--bg-spare), so their process tree roots at launchd. no tmux ancestor anywhere in the chain - the only tmux-attached process is the agents picker itself, which fires
SessionStartonce and then nothing per-turn
i verified this empirically with a probe hook that logged session_id, transcript_path, $TMUX_PANE, and the full PPID chain for every hook event. confirmed the topology split: the process with pane context fires only SessionStart, the processes with per-turn hooks have no pane context.
Proposed Solution
any of these would solve it (in order of preference):
- fire
statusLinein the agents-view pane on each focused-session turn — simplest, matches the existing per-pane contract. JSON payload already has everything needed. - expose the currently-focused
session_idvia env var or sidecar file owned by the picker process — i can do the rest myself (readtranscript_path, scrape usage). env var on the picker process is fine; a/tmp/.claude_agents_focus_<picker_pid>.jsonfile would also work. - fire a hook event when focus changes inside agents-view — same data, different shape. would let me write the sidecar from hook context.
Alternative Solutions
- tried a per-turn hook (
UserPromptSubmit/PostToolUse) thinking i could walk up to the tmux pane from the hooks pid — process tree roots at launchd via--bg-pty-host, no tmux ever reachable - considered a "most recent activity globally within N seconds" heuristic across all live sessions, but fragile if multiple sessions are concurrently active
- current workaround is rendering blank ctx% in agents-view panes (honest "i cant tell" beats confidently-wrong, but loses the signal)
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- tmux pane running
claude agents - drill into a sub-chat with right-arrow, work through a long task
- context window fills up; HUD ideally shows ctx% creeping up so i can compact before forced compaction fires
- today: HUD column is blank in this pane, no way to see compaction risk approaching
- with any of the proposals above: HUD updates per turn, same as a normal
claudepane
Additional Context
CC 2.x is iterating agents-view actively — happy to test patches behind a feature flag if helpful. the statusLine contract is already well-documented; option 1 is probably a few-line change in whichever process owns the agents-view pane render loop.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗