[BUG] Temporary files (tmpclaude-xxxx-cwd) not cleaned up after Bash execution on Windows
Resolved 💬 4 comments Opened Jan 13, 2026 by OscarFriasZavalza Closed Feb 27, 2026
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?
Description
Temporary files with the naming pattern tmpclaude-xxxx-cwd are created during Bash command execution but are not being cleaned up afterward. These files accumulate over time in the working directory.
What Should Happen?
Temporary files created during Bash command execution should be automatically deleted after the command completes. The working directory should remain clean without accumulating tmpclaude-xxxx-cwd files across sessions.
Error Messages/Logs
Steps to Reproduce
- Open Claude Code in a project directory
- Execute any Bash command (e.g.,
ls -la,git status, etc.) - Check the working directory for files matching pattern
tmpclaude-xxxx-cwd - Execute additional Bash commands
- Observe that new
tmpclaude-xxxx-cwdfiles are created and previous ones are not deleted - Close and reopen Claude Code session
- Notice that all previously created temporary files still remain in the directory
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.6 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
- Each
tmpclaude-xxxx-cwdfile contains only the current working directory path in Unix format (e.g.,/c/Users/DELL/Documents/path/to/project) - File size: approximately 58 bytes per file
- The files appear to be used for tracking the current working directory during Bash execution
- No error messages are shown during creation or when the cleanup fails
- The issue persists across different types of Bash commands (ls, git, etc.)
- Files show up in
git statusas untracked files if the directory is a git repository - The cleanup mechanism may be failing specifically on Windows systems due to file locking or path format issues
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗