[BUG] Claude Code creates persistent temporary files tmpclaude-* in the workspace
Resolved 💬 19 comments Opened Jan 12, 2026 by iring114 Closed Apr 18, 2026
💡 Likely answer: A maintainer (claude[bot], contributor)
responded on this thread — see the highlighted reply below.
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: 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.
<img width="259" height="110" alt="Image" src="https://github.com/user-attachments/assets/cee7e86a-f93c-4620-bd98-9be7a3d4c283" />
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:
- Start Claude Code in a project directory.
- Perform tasks (e.g., editing files or running commands).
- 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.5.1
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
19 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
https://github.com/anthropics/claude-code/issues/17568#issuecomment-3736945382
Same issue here on Windows 11 with Claude Code.
Every Bash tool invocation creates a new
tmpclaude-XXXX-cwdfile in the working directory. The more commands Claude runs, the more files accumulate. Ironically, trying to clean them up with Bash creates even more! 😅Workaround: Added
tmpclaude-*to.gitignoreto prevent git pollution, but the files keep piling up in the filesystem.+1 for fixing this - it's a bit annoying on Windows.
Same here on Windows with CLI! I'll stop yelling at poor Claude now ;)
Same Issue my entire software team is experiencing this on windows now.
Just started getting this issue since a few hours.
same issue happened to me. Best way for now is to stay in 2.1.4 version until it's being fixed. The whole 2.1.5 update is all about temporary file management anyway.
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code@2.1.4
Rolling back to v2.1.4 worked for me as well.
PowerShell native installer rollback:
& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.1.4Rolling back worked for me too! 👍🏼
still happening on 2.1.6
I thought npm is deprecated - or does that install native by default now?
The issue is not bound to the way Claude Code is installed. I'm facing the same issue with native install too.
Temporary Workaround: Automated Cleanup
I've created an automated solution that cleans up these temp files automatically: tmpclaude-auto-cleanup
Quick Setup (30 seconds)
Just copy the prompt from
CLAUDE_PROMPT.mdand paste it into Claude Code. Claude will configure everything automatically.What It Does
git statusManual Setup
Full instructions and manual configuration files available in the repo.
---
Note: This is a workaround until the core issue is fixed in Claude Code CLI. The real bug still needs to be addressed by Anthropic.
Some clarity as to why this is a pain point for me, and probably others:
These temp files are created WITHIN the code repository. As such, they are tracked and committed by git (and probably other src ctrl) unless we opt OUT (via .gitconfig) or exert diligence. I don't think anyone WANTS these files in src control.
It feels like a temporary growing pain issue that will be resolved eventually, so I am not very motivated to update my .gitignore on the various projects I work on to exclude tmpclaude-*, since I suspect the setting will become moot eventually. I have pinned my claude code release to 2.1.4 by disabling the auto updater in my ~\.claude\settings.json
"DISABLE_AUTOUPDATER": "1"until I see this issue or one of its sibling issues resolved.If a project/repo level temp area is absolutely necessary, might I suggest .claude\temp and maybe offer to update our .gitignore for us? Better, would be ~\.claude\temp or a system temp which is not within the code repository.
I hope this helps illustrates the impact of this issue, and that a timely fix may be forthcoming.
This is fixed bro, 2.1.7 came out yesterday and they have stopped appearing
@RobertHauta i had this exact issue in 2.1.7, albeit it was the latest release not tagged as stable at that time.
/tmp/issue-17636-answer.md
This is a duplicate of #17600, which was fixed as of version 2.1.47.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.