[BUG] Plan mode's markdown output contains broken relative path links
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?
Using VS Code's Claude Code extension, after performing a plan mode prompt and opening the generated markdown file, links to source code implementation details are broken.
The plan file gets saved under my user directory e.g. (\users\robmeyer\.claude\plans\yada-yada.md) while the markdown links use a relative path format, relative to the git repo's root. Opening them in VS Code with cmd+click results in The editor could not be opened because the file was not found.
What Should Happen?
Any markdown links should be relatively pathed according to where the plan file is going to be saved.
- Claude could continue generating repo-relative pathed markdown links as long as it saves the plan file to the repo root directory.
- Alternatively, build relative paths taking into account the relative path difference between the plan directory and project root
- Use absolute paths
Of the choices above, (1) is likely the ideal solution. It allows the plan to be commit to source control and shared with other team members. If the user wishes to move it out of the project, many IDEs will update the relative path links automatically. Options (2) and (3) improve upon the current broken-link experience, but leave something to be desired in terms of ability to collaborate through source control.
Error Messages/Logs
Steps to Reproduce
- Open VS Code with folder or workspace scope and VS Code Claude extension installed
- Switch Claude Code to plan mode
- Ask about something that will generate a plan including links to implementation details (e.g. a simple refactoring of existing code)
- In Claude's output, there should be a "Write <yada-yada-random-identifier>.md" step. Click the md file link to open it as a tab in VS Code. Note: This file is saved under
/Users/<username>/.claude/plans/yada-yada-random-identifier.mdby default (Mac) - Locate any relative path link and ⌘+Click to navigate to the file or file+line-number.
Expected: File opens in VS Code tab, source code displayed. If link included a #<line number> suffix, that line is selected and scrolled into view.
Actual: Attempts to open \Users\<username>\.claude\plans\relative\path\from\project\root\file.ext which isn't a valid path to a file. VS Code either prompts whether you'd like to create this file or displays The editor could not be opened because the file was not found. error message with a "Create file" button.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
anthropic.claude-code 2.1.179
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
I haven't checked if this also reproduces in the CLI Claude Code.