No tool available to enumerate running background bash tasks

Resolved 💬 4 comments Opened Apr 16, 2026 by millermackj Closed Apr 20, 2026

Summary

When Claude launches background bash tasks via Bash(run_in_background=True), there is no tool to list or discover them. TaskList is unrelated (it only shows TaskCreate items). TaskStop and TaskOutput both require a task ID. If the task ID is lost — e.g. through a long conversation or context compaction — the process becomes unmanageable from Claude's side.

Reproduction

  1. Run Bash(command="sleep 99999", run_in_background=True) — returns a task ID
  2. There is no tool call that can rediscover this task or its ID
  3. TaskStop and TaskOutput work correctly when given the ID directly

Observed behavior

  • Running background tasks are visible to the user in the Claude Code UI
  • Claude has no corresponding API to enumerate them
  • The only recovery path is scrolling back through the conversation to find the task ID

Expected behavior

A tool (e.g. an extension to TaskList, or a dedicated TaskListBackground) that surfaces running background bash tasks with their IDs, commands, and status — mirroring what the UI already shows.

Additional context

  • TaskStop and TaskOutput work correctly by ID — the missing piece is discovery
  • Non-terminating background commands (e.g. log followers) can accumulate silently across a session with no way for Claude to detect or clean them up

View original on GitHub ↗

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