Feature Request: Add ListTasks tool for discovering background task IDs
Problem
Claude can start background tasks with Bash({ run_in_background: true }) but has no way to discover existing task IDs from previous conversations or sessions.
The /tasks CLI command shows running tasks to users, but there's no programmatic equivalent for Claude to call.
Current Limitation
What Claude can do:
- ✅ Start background tasks:
Bash({ command: "./start.sh", run_in_background: true })→ returns task_id - ✅ Check task output:
TaskOutput({ task_id: "xyz" }) - ✅ Stop tasks:
TaskStop({ task_id: "xyz" })
What Claude cannot do:
- ❌ List running tasks to discover task IDs
- ❌ Resume managing tasks from previous conversations
- ❌ Find tasks started by the user or other sessions
Current Workaround
Users must:
- Run
/tasksCLI command themselves - Manually provide task IDs to Claude
- Or manage tasks entirely through the CLI
This creates a gap where background tasks persist across conversations, but Claude loses access to them without user intervention.
Proposed Solution
Add a ListTasks() tool (or GetRunningTasks()) that returns information about all running background tasks:
ListTasks()
// Returns:
[
{
task_id: "task-abc123",
command: "./start.sh",
status: "running",
runtime: "65h 23m 11s",
output_file: "/path/to/output",
started_at: "2025-01-15T10:30:00Z"
}
]
Use Cases
Cross-conversation continuity:
[Previous conversation]
User: "Start the backend server"
Claude: Bash({ command: "./start.sh", run_in_background: true })
[New conversation, context cleared]
User: "Stop the backend server"
Claude: ListTasks() → finds task_id → TaskStop({ task_id: "..." })
Task management:
User: "What's running in the background?"
Claude: ListTasks() → "You have ./start.sh running for 65 hours"
Cleanup:
User: "Stop all background tasks"
Claude: ListTasks() → StopTask for each
Consistency
This would align with the existing pattern:
- Users have
/tasksCLI command - Claude should have programmatic equivalent
- Other task tools (TaskOutput, TaskStop) already exist but require task_id
Evidence
See attached screenshot showing /tasks CLI output - this information exists in the system but isn't accessible to Claude programmatically.
!/tasks CLI output showing running background task
Priority
Impact: Medium-High
- Background tasks are a core feature
- Cross-conversation task management is currently broken
- Workaround exists but requires manual intervention
Effort: Likely Low
/taskscommand already implements the logic- Just needs to be exposed as a tool with structured output
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗