[BUG] Claude code run /init error
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: <!-- specify -->
- Claude CLI version: 1.0.53 (Claude Code)
- Operating System: Windows 11
- Terminal: powershell
Bug Description
<!-- A clear and concise description of the bug -->
when I run init in window platform, I got a error:
check from about error,the resean is write to CLAUDE.md,so how to fix this error.
● Update Todos
⎿ ☐ Identify the specific error when writing to CLAUDE.md
☐ Test file write permissions and access
☐ Provide solution to fix the CLAUDE.md write error
● Bash(echo "test write" > CLAUDE.md)
⎿ (No content)
● Read(CLAUDE.md)
⎿ Read 2 lines (ctrl+r to expand)
● Update Todos
⎿ ☒ Identify the specific error when writing to CLAUDE.md
☒ Test file write permissions and access
☐ Provide solution to fix the CLAUDE.md write error
● The file write test worked successfully. Let me check if there's a specific error
with the Write tool:
the error is appeal again:node:internal/process/promises:394
triggerUncaughtException(err, true / fromPromise /);
^
Error: cannot open
_claude_fs_right:e%3A%5CWorkSpace%5CAffiliateMarketing%5CAutoOffers%5CCLAUDE.md.
Detail: Unable to resolve filesystem provider with relative file path
'_claude_fs_right:e:\WorkSpace\AffiliateMarketing\AutoOffers\CLAUDE.md'
at Kc2 (file:///C:/Users/willwa/AppData/Roaming/npm/node_modules/@anthropic-ai/
claude-code/cli.js:1248:14641)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async pD4 (file:///C:/Users/willwa/AppData/Roaming/npm/node_modules/@anthrop
ic-ai/claude-code/cli.js:2611:11207)
at async J (file:///C:/Users/willwa/AppData/Roaming/npm/node_modules/@anthropic
-ai/claude-code/cli.js:2611:9917)
Node.js v22.17.0
● This is a Claude Code CLI internal error with file path resolution on Windows. The
error shows it's trying to resolve a malformed file path with _claude_fs_right:
prefix.
● Update Todos
⎿ ☒ Diagnose Claude Code CLI file path resolution error
☐ Provide workaround solutions for CLAUDE.md write error
● Solutions to fix the CLAUDE.md write error:
- Use forward slashes instead of backslashes:
cd E:/WorkSpace/AffiliateMarketing/AutoOffers
- Use relative path:
cd AutoOffers
- Use Bash tool instead of Write tool:
echo "content" > CLAUDE.md
- Update Claude Code CLI:
npm update -g @anthropic-ai/claude-code
The error is a Windows path resolution bug in Claude Code CLI. Try using forward
slashes or relative paths when working with files.
● Update Todos
⎿ ☒ Diagnose Claude Code CLI file path resolution error
☒ Provide workaround solutions for CLAUDE.md write error
how to modify this error in which file.
● Update Todos
⎿ ☐ Locate Claude Code CLI installation and source files
☐ Identify the specific file causing the path resolution error
● Based on the error stack trace, the issue is in the Claude Code CLI installation
file:
File location:
C:/Users/willwa/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js
Error location: Line 1248, character 14641 in the Kc2 function
However, you cannot modify this file directly because:
- It's a compiled/minified JavaScript file
- It's part of the npm package installation
- Changes would be overwritten on updates
Better solutions:
- Report the bug: https://github.com/anthropics/claude-code/issues
- Use workarounds: Use Bash tool instead of Write tool for file operations
- Wait for fix: Update Claude Code CLI when patch is released
The error is in Claude Code's internal file system provider, not your code.
● Update Todos
⎿ ☒ Locate Claude Code CLI installation and source files
☒ Identify the specific file causing the path resolution error
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗