Sub-agent shows "(running)" in status bar after conversation compaction even though it's no longer active

Resolved 💬 5 comments Opened Mar 9, 2026 by amitsadhu Closed Apr 8, 2026

Bug

When a conversation is compacted (due to context window limits) while sub-agents are still running, the status bar continues to show the agent as "(running)" even after it has completed or been lost.

Steps to reproduce

  1. Spawn multiple sub-agents (e.g. 6 parallel agents for code fixes)
  2. Let the conversation hit context limits and get compacted while agents are still in-flight
  3. After compaction, the status bar still shows an agent as "(running)" with "↓ to manage · esc to interrupt"
  4. TaskList returns no tasks, and the agent's work is effectively orphaned

Expected behavior

After compaction, orphaned agents should either:

  • Be cleaned up and removed from the status bar
  • Or be marked as "lost/interrupted" rather than showing "(running)"

Actual behavior

The status bar indefinitely shows the agent as "(running)" with no way to dismiss it other than restarting the session.

Environment

  • Claude Code CLI
  • macOS Darwin 25.1.0
  • Model: claude-opus-4-6

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗