Skip to content

Claude Code pane reports idle while a run_in_background shell tool call is still running #2241

Description

@olegopro

Is this a reproducible bug?

  • I confirm this is a reproducible bug, not a feature request, idea, question, contribution proposal, or direction check.
  • I reproduced this bug on the version and environment reported below using the exact steps provided.

Current behavior

When a Claude Code turn ends while a run_in_background shell tool call is still executing, the pane's transcript keeps showing e.g. "2 shells still running" and the prompt is empty — but herdr reports the pane as idle/done, not working.

Confirmed against the shipped manifest (~/.local/state/herdr/agent-detection/remote/claude.toml, version 2026.07.13.1): osc_title_working (priority 1100, region osc_title, matches a Braille spinner glyph in the title) is the only rule anywhere in the manifest with state = "working". Once the turn ends, the title switches to a static ✳ <task> (matched by osc_title_idle), and live_prompt_box (priority 950, matches an empty in the prompt body) then classifies the pane as idle. No rule reads the pane's own "N shell(s) still running" text, so a live backgrounded shell has no way to register as working.

Also checked herdr pane process-info as a possible fallback signal: it can't help either. The backgrounded shell isn't a member of the tty's foreground process group at all — only the claude binary and unrelated child processes (MCP servers, language server, etc.) show up there.

Expected behavior

The pane reports working (or a distinct state) while a Claude Code run_in_background shell tool call is still executing, even after the foreground turn has ended and the prompt is idle.

Reproduction

  1. Open a Claude Code pane in herdr, herdr 0.7.5, stable channel.
  2. Ask Claude to run something long in the background, e.g.: "run sleep 40 in the background."
  3. Once Claude's reply finishes and the pane returns to the empty prompt (transcript still shows "N shell(s) still running"), run from another terminal:
    herdr agent get <pane_id> and herdr agent explain <pane_id>.

Actual captured output at T+10s after the turn ended, while the background shell was still confirmed running (pane transcript showed "Cooked for 55s · 2 shells still running" at that exact moment):

$ herdr agent get w1K:p1
{"agent_status":"done", ... ,"terminal_title":"✳ Fix loading indicator in Shell command execution", ...}

$ herdr agent explain w1K:p1
agent: claude
state: idle
manifest: remote:/Users/superoleg/.local/state/herdr/agent-detection/remote/claude.toml 2026.07.13.1
rule: live_prompt_box (region=prompt_box_body priority=950)
evidence: "❯\n"

Impact

Any sidebar/automation use that relies on herdr's agent status to know a Claude Code pane is still doing something (e.g. herdr wait agent-status --status working, or just glancing at the sidebar to see which panes are still busy) misses backgrounded shell work entirely. The pane looks finished/idle in the UI while a real command is still running, so it's easy to switch away and forget about it.

Environment

  • Herdr version: 0.7.5
  • Update channel (stable or preview): stable
  • Operating system: macOS (Darwin 25.6.0)
  • Terminal: Apple Terminal (Terminal.app), TERM=xterm-256color
  • Shell, if relevant: zsh
  • Relevant config, if any: default claude.toml manifest, version 2026.07.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-neededrequires maintainer judgment or maintainer-only reproduction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions