[Bug] Plan mode implementation session not registered in sessions-index.json, cannot --resume
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?
After approving a plan in plan mode, Claude Code clears context and creates a new session to implement the plan. This implementation session:
- Has a complete
.jsonlfile (367 lines of conversation history) - Is not registered in
sessions-index.json - Does not appear in the
claude --resumeinteractive picker list
The session can still be resumed if you know the exact session ID (claude -r <id>), but there is no way to discover it through the normal --resume picker. Users have no easy way to find this session ID unless they manually inspect .jsonl files on disk.
This is particularly frustrating because plan mode implementation sessions often contain extensive file modifications and tool calls. If the session is interrupted or you want to continue later, you cannot find it to resume.
What Should Happen?
The implementation session created after plan approval should be registered in sessions-index.json and appear in the claude --resume interactive picker list.
Steps to Reproduce
- Start a Claude Code session in a project directory
- Enter plan mode and create a plan
- Approve the plan — select "Yes, clear context and auto-accept edits" (the default)
- Claude clears context and creates a new session to implement the plan
- Complete the implementation and exit
- Run
claude --resume→ the implementation session does not appear in the picker list
Evidence
The implementation session .jsonl file exists and contains a complete conversation:
$ wc -l 7e76a3eb-5882-4a70-819f-81b91687d8bf.jsonl
367
The session has all the hallmarks of a normal session (userType: "external", valid slug, file-history-snapshot entries), but is absent from sessions-index.json:
import json
with open('sessions-index.json') as f:
indexed = {e['sessionId'] for e in json.load(f)['entries']}
target = '7e76a3eb-5882-4a70-819f-81b91687d8bf'
print(f'{target} in index: {target in indexed}') # False
The first user message is auto-injected by the plan mode system:
{
"type": "user",
"message": {
"content": "Implement the following plan:\n\n# ..."
},
"userType": "external",
"slug": "smooth-watching-candy"
}
This suggests that the "clear context and implement" flow creates the .jsonl file but skips writing to sessions-index.json.
Related Issues
- #20797 — Same root cause: plan mode "clear context" creates a new session that is not fully integrated (symptoms: tasks orphaned)
- #18311 — Similar symptom:
--resumecannot find sessions despite files existing
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.42 (version when the session was created)
Platform
Anthropic API
Operating System
macOS 26.2 (Darwin 25.2.0, arm64, Apple Silicon)
Terminal/Shell
zsh
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗