[BUG] Task list ID not inherited when transitioning from plan mode to execution
Resolved 💬 3 comments Opened Jan 29, 2026 by purecod3 Closed Jan 29, 2026
Description
When exiting plan mode and beginning execution, Claude Code creates a new session instead of continuing with the same session ID. This causes task updates to be lost because:
- Tasks created during plan mode are persisted under the plan session's ID
- Execution happens in a new session with a different ID
TaskUpdatecalls in the new session update in-memory tasks but don't persist to the original task files
Steps to Reproduce
- Start Claude Code and enter plan mode
- Create tasks (via
TaskCreate) - they persist to~/.claude/tasks/{plan-session-id}/ - Exit plan mode and begin execution
- Use
TaskUpdateto mark tasks asin_progressandcompleted - Check the task files on disk - still show
"status": "pending"
Evidence
After a full session with plan mode → execution:
$ ls ~/.claude/projects/-mnt-c-Users-{username}-Repos-tasktest/
43bb0393-387c-488f-9d9f-71dbfc2cdc6f.jsonl # Plan mode session (135KB)
a785bf3c-dba4-4673-b5a4-675837ab398d.jsonl # Execution session (3.2MB)
$ ls ~/.claude/tasks/
43bb0393-387c-488f-9d9f-71dbfc2cdc6f/ # Has 10 task JSON files (all "pending")
a785bf3c-dba4-4673-b5a4-675837ab398d/ # Empty (just .lock file)
Checking for status updates in each session transcript:
$ grep -c '"status":"completed"' .../43bb0393...jsonl
0
$ grep -c '"status":"completed"' .../a785bf3c...jsonl
30 # Updates happened here but persisted nowhere
Expected Behavior
Either:
- Plan mode and execution should share the same session ID, OR
- The task list ID should be automatically inherited when transitioning from plan to execution (similar to what's expected with
--fork-session)
Actual Behavior
- New session ID is created after exiting plan mode
- Tasks remain in the old session's folder with
"status": "pending" - 42
TaskUpdatecalls in the execution session had no persistent effect
Impact
- Cannot resume task lists across sessions
- Work tracking is lost if session ends
- Defeats the purpose of persistent task storage
Environment
- Platform: Linux (WSL2)
- Claude Code version: 2.1.21
Related Issues
- #20664 -
--fork-sessiondoes not inheritCLAUDE_CODE_TASK_LIST_ID(same root cause: session transitions don't preserve task list context)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗