Windows: Temp CWD marker files created in working directory instead of TEMP folder

Resolved 💬 2 comments Opened Jan 13, 2026 by muddy-clay Closed Feb 27, 2026

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

  1. Run Claude Code on Windows
  2. Work in any project directory
  3. Observe files appearing with names like:
  • cWINDOWSTEMPclaude-3f21-cwd
  • cWINDOWSTEMPclaude-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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗