claude-code - 💡(How to fix) Fix Expose per-session/bg-job state visually in the terminal (extend agent-view color cues to split panes)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Problem

When running many Claude Code sessions in parallel, the new agent view does a great job of surfacing "needs input" via a kanban on the main screen. But many of us split a single terminal vertically into multiple Claude Code panes and want at-a-glance visual state per pane — without context-switching to the agent view.

What works today

For interactive sessions, you can hook Stop / UserPromptSubmit / PermissionRequest to emit an iTerm2 OSC 1337 SetColors escape sequence to /dev/tty, which colors the pane (e.g. green = idle, blue = working, red = permission pending). This is exactly what the community iterm-claude-colors skill does.

What doesn't work

Background jobs (spawned via run_in_background: true) are detached children with no controlling terminal, so:

  1. Their own hooks can't write to /dev/tty — they fail with Failed with non-blocking status code: /bin/sh: /dev/tty: Device not configured. (Currently noisy; we guard with [ -w /dev/tty ] && … || true.)
  2. Even if they could open a tty, they don't know their parent pane's tty, so they can't reach back to color the pane that launched them.

The harness already classifies bg-job state (working / needs input / completed / failed) — that's what the agent view consumes. There's just no way to plumb that state into the originating terminal pane.

Proposed feature (any of these would solve it)

  1. Parent-side hook event for child bg-job state changes. A hook that fires in the parent session's process (which still has the pane's TTY) when one of its bg jobs transitions state, with the new state as input. Hook authors can then emit color escapes themselves.
  2. Built-in pane-color signaling. A config flag like "terminalStateColors": true that, in iTerm-capable terminals, emits the OSC 1337 sequence from the foreground process whenever the session's aggregate state (own state ∪ children's state) changes.
  3. Machine-readable state file per session. Write current state to e.g. $CLAUDE_SESSION_DIR/state.json so external watchers (iTerm Triggers, a tmux statusline, a custom daemon) can drive their own coloring.

Setup

  • macOS, iTerm2, multiple vertical split panes each running claude
  • Heavy use of bg jobs launched from those panes
  • Already using the agent view; this is a complement, not a replacement

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Expose per-session/bg-job state visually in the terminal (extend agent-view color cues to split panes)