[BUG] plan file path should be included in context, when using `clear context and auto-accept edits` option
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 creating a plan, when you use the Yes, clear context and auto-accept edits option, what seems to happen is that it clears context, and then the _contents_ of the plan file is injected inline into the new context.
This is problematic because it does not _also_ include a reference to the actual plan file path itself! It's only passing the contents along, and not the path.
So if you stop the implementation, and ask Claude "what is the current plan file" it doesn't know.
If you ask Claude to reference or amend the current plan, it can't - it can only reconstruct from memory.
I've setup various /skills and /commands that work by either reading the plan file, or passing it's path on to subagents to read. These don't work very well now, because the context no longer has a reference to the actual plan file's path.
Even things like just wanting to open and read and amend the plan file yourself at this point become difficult, since it doesn't even print the plan files path onscreen - per https://github.com/anthropics/claude-code/issues/25029
Of course, the plan file still exists - so you can check in ~/.claude/plans for it. But good luck finding it if you have multiple agents running, due to the random file names they generate. I have to open each of the last 4 or 5 plan files to find the one I'm after.
So this is a bit of a problem IMO. I think just displaying / including the plan file path after using Yes, clear context and auto-accept edits would be an easy and good change to make.
What Should Happen?
Plan file path should be included whenever displaying the plan file inline, including after using the Yes, clear context and auto-accept edits option
Error Messages/Logs
Steps to Reproduce
- Trigger claude to create a plan file
- Use the
Yes, clear context and auto-accept editsoption - Stop the implementation and ask Claude what the current plan file is. It won't know.
No, I don't know the exact file path of the plan file. The plan content was provided to me when you approved it, but the file path where it was written during plan mode wasn't included in my current context.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.41 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗