[BUG] Task list persists after aborting a plan mid-execution
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?
When Claude Code is in the middle of executing a plan (with an active task list created via TaskCreate), and the user aborts the run (e.g. ESC), the in-progress/pending tasks from that plan stay in the task list. They persist into the next turn even when the next user prompt is unrelated to the original plan, so Claude continues to see — and sometimes act on — stale tasks from a workflow the user already abandoned.
/clear does not clear them either: after /clear, when the next message kicks off a new request, the abandoned task list is still surfaced to the model in context.
This looks closely related to #41542 (TODO list not restored after /rewind) — same underlying issue of the task list not being tied to the active conversation/turn lifecycle. The trigger here is abort + unrelated next prompt (and /clear), rather than /rewind.
What Should Happen?
Aborting a plan mid-execution should leave the task list in a state that doesn't poison subsequent unrelated turns. At minimum:
- When the next user prompt is clearly unrelated to the aborted plan, the prior task list should not be presented as live work.
/clearshould reset the task list along with the rest of the session state.
Error Messages/Logs
(no error — silent state carryover)
Steps to Reproduce
- Start a Claude Code session and invoke a complex skill / slash command that causes Claude to generate a plan and create a task list (TaskCreate with multiple in-progress/pending items).
- While the plan is mid-execution, hit ESC to abort.
- Send an unrelated next prompt (e.g. \"what time is it in Tokyo?\").
- Observe: the abandoned task list is still active and visible to the model. Claude may reference or attempt to resume those tasks despite the new prompt being unrelated.
- Run
/clearand send another prompt — the stale tasks are still present.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.128 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Likely related to #41542 — same task-list-persistence root cause, different trigger (abort + unrelated prompt / /clear, rather than /rewind).
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗