[BUG] Background process listing out of sync
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I am running Claude Code in the regular Mac Terminal. Claude has started a couple of background tasks so I see "2 background tasks" in the status bar below the input field. But when I press arrow down and enter to look at the process listing, I see a huge collection of processes, many of which I know finished during yesterday.
╭────────────────────────────────────────────────────────────────────────────╮
│ Background tasks │
│ 12 active shells │
│ │
│ ❯ sleep 600 && ps aux | grep 'url-filter.… (running) │
│ sleep 600 && ps aux | grep 'url-filter.… (running) │
│ cd data-2026-01-09 && ../url-filter.py … (running) │
│ cd data-2026-01-09 && ../url-filter.py … (running) │
│ ./identify-stale-categorizations.py dat… (running) │
│ ./identify-stale-categorizations.py dat… (running) │
│ ./identify-url-templates.py data-2026-0… (running) │
│ ./identify-url-templates.py data-2026-0… (running) │
│ ./identify-url-templates.py data-2026-0… (running) │
│ while [ $(tail -1 data-2026-01-09/filte… (running) │
│ cd data-2026-01-09 && python3 ../url-fi… (running) │
│ cd data-2026-01-09 && python3 ../url-fi… (running) │
│ ./identify-stale-categorizations.py dat… (killed) │
│ ./identify-stale-categorizations.py dat… (killed) │
│ ./identify-url-templates.py data-2026-0… (done) │
│ ./identify-url-templates.py data-2026-0… (error) │
│ ./identify-url-templates.py data-2026-0… (killed) │
│ cd data-2026-01-09 && python3 ../url-fi… (done) │
│ while [ $(tail -1 data-2026-01-09/filte… (killed) │
│ cd data-2026-01-09 && python3 ../url-fi… (done) │
│ cd data-2026-01-09 && python3 ../url-fi… (done) │
╰────────────────────────────────────────────────────────────────────────────╯
↑/↓ to select · Enter to view · k to kill · Esc to close
Out of these, the top four are actually the ones which are still running (separate bug: why are the two background tasks duplicated?) and the rest have finished in the somewhat distant past. If I select the fifth one identify-stale-categorizations.py it tells me "Status: running" and "Runtime: 17h 8m 15s" (still counting up) but I know this task finished yesterday because I have examined its results and discussed them with Claude.
Weirdly the "2 background processes" in the main UI has the correct count, so in some sense Claude seems to know which processes are _actually_ still running.
What Should Happen?
The process listing should only show (running) on processes which are actually running.
The process listing should only show each background process once.
Error Messages/Logs
Steps to Reproduce
Beyond "run background tasks, wait for them to finish" I have no idea what exactly is required to trigger this. Having a long-running session might be a prerequisite in practice.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.6 (Claude Code)
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗