claude-code
claude-code copied to clipboard
tmpclaude-*-cwd temp files not cleaned up on Windows after bash commands
Description
Claude Code creates temporary files (tmpclaude-XXXX-cwd) in the working directory to track the current working directory for bash command execution. These files are not being cleaned up after commands complete on Windows.
Environment
- OS: Windows (win32)
- Shell: Git Bash
- Claude Code version: current (as of Jan 2025)
Steps to Reproduce
- Run Claude Code on Windows
- Execute several bash commands during a session
- Check the working directory for
tmpclaude-*files
Observed Behavior
Multiple temp files accumulate in the project directory:
-rw-r--r-- 1 user 197609 46 Jan 12 19:05 tmpclaude-108f-cwd
-rw-r--r-- 1 user 197609 46 Jan 12 19:13 tmpclaude-295d-cwd
-rw-r--r-- 1 user 197609 46 Jan 12 19:00 tmpclaude-3006-cwd
... (18+ files in one session)
Each file is 46 bytes containing the Git Bash-style working directory path:
/c/Users/username/Documents/Project
Expected Behavior
These temp files should be deleted after bash command execution completes.
Likely Cause
The cleanup code may not be handling Windows path conversion properly (Windows C:\... vs Git Bash /c/...), or the cleanup hook isn't being triggered.
Workaround
Add tmpclaude-* to .gitignore and periodically delete manually.