[BUG] Claude Code creates persistent temporary files tmpclaude-* in the workspace
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?
<img width="259" height="110" alt="Image" src="https://github.com/user-attachments/assets/99e69784-9541-41e5-b569-2f4ed602dd90" />
Description: I noticed that while using Claude Code, several temporary files with the prefix tmpclaude- are automatically generated in my project directory and are not being cleaned up.
What Should Happen?
Expected Behavior: Temporary files should either be created in a system temp directory or be automatically deleted after the process finishes.
Error Messages/Logs
Steps to Reproduce
Steps to Reproduce:
1.Start Claude Code in a project directory.
2.Perform tasks (e.g., editing files or running commands).
3.Observe the file tree.
Observed Behavior: Files like tmpclaude-0e27-cwd, tmpclaude-9f7f-cwd, etc., appear in the file explorer (marked as untracked "U" in Git).
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗