claude-code - 💡(How to fix) Fix No tool available to enumerate running background bash tasks [2 comments, 3 participants]

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…
GitHub stats
anthropics/claude-code#49140Fetched 2026-04-17 08:49:45
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×2

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.

Error Message

  • 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

Root Cause

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.

RAW_BUFFERClick to expand / collapse

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

extent analysis

TL;DR

Implement a new API endpoint or extend TaskList to discover and list running background bash tasks with their IDs, commands, and status.

Guidance

  • Investigate extending the TaskList API to include background tasks by adding a filter or flag to distinguish between TaskCreate items and background tasks.
  • Consider creating a new API endpoint, such as TaskListBackground, to specifically handle the discovery of running background bash tasks.
  • Review the Claude Code UI implementation to understand how it displays running background tasks and replicate this functionality in the API.
  • Evaluate the feasibility of storing task IDs and associated metadata in a cache or database to facilitate task discovery and management.

Example

# Hypothetical example of an extended TaskList API
def TaskList(background=True):
    # Filter tasks to include background tasks if background flag is True
    tasks = [task for task in tasks_list if task['run_in_background'] == background]
    return tasks

Notes

The solution may require modifications to the existing TaskList API or the introduction of a new API endpoint. The implementation details will depend on the specific requirements and constraints of the Claude system.

Recommendation

Apply a workaround by implementing a new API endpoint, such as TaskListBackground, to discover and list running background bash tasks. This approach allows for a more targeted solution to the problem without modifying the existing TaskList API.

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…

FAQ

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.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING