Windows: Temp CWD marker files created in working directory instead of TEMP folder
Description
On Windows, Claude Code creates session marker files (CWD breadcrumbs) in the current working directory instead of the system temp folder. The Windows path C:\WINDOWS\TEMP\claude-xxxx-cwd gets mangled into a filename like cWINDOWSTEMPclaude-xxxx-cwd.
Steps to Reproduce
- Run Claude Code on Windows
- Work in any project directory
- Observe files appearing with names like:
cWINDOWSTEMPclaude-3f21-cwdcWINDOWSTEMPclaude-0845-cwd- etc.
Expected Behavior
Files should be created at C:\WINDOWS\TEMP\claude-xxxx-cwd (or %TEMP%\claude-xxxx-cwd)
Actual Behavior
The path separators and colon are stripped/removed, turning the intended path into a filename that gets created in the current working directory:
- Intended:
C:\WINDOWS\TEMP\claude-3f21-cwd - Actual:
./cWINDOWSTEMPclaude-3f21-cwd
File Contents
Each file is 38 bytes containing just the working directory path:
/c/Users/Clay/source/repos/notes-page
Environment
- OS: Windows 11
- Shell: Git Bash / MINGW64
- Claude Code: Latest version
Workaround
Add to .gitignore:
cWINDOWSTEMP*
**/cWINDOWSTEMP*
Analysis
Likely cause: Path construction using forward slashes or string concatenation that doesn't account for Windows path format, possibly combined with Git Bash's Unix-style path handling.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗