[BUG] Stale tasks cannot be cleared
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?
OS: Ubuntu 24.04.4 LTS
Shell: SSH --> Ubuntu ZSH
Description
My Claude Code session persistently shows "18 tasks (10 done)". All the tasks are stale and have been completed although I do not know when. However if I run /tasks, it shows no tasks.
When I query Claude, it states:
- It finds no running tasks it owns in
ps - There is no task-manifest file to clean
- TaskStop finds no live tasks
It suggests starting a new session to clear, which I do not want to do due to context, history, and memory.
It is unclear how or exactly when the session got to this state, but I did have a power outage affecting the system causing a hard disconnect around the same time.
The majority of issue reports on stale tasks seem related to /compact but I doubt this caused my situation as I have never had an issue with /compact before.
What Should Happen?
Claude should be able to auto / manually garbage clean stale tasks, even on hard disconnects.
Error Messages/Logs
None.
Steps to Reproduce
See description above, not consistently reproducible.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.218
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗