[BUG] creates `tmpclaude-*-cwd` files in the current working directory
Resolved 💬 72 comments Opened Jan 12, 2026 by seeper0 Closed Feb 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
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?
Claude Code 2.1.5 creates tmpclaude-*-cwd files in the current working directory instead of /tmp. These files are never cleaned up and accumulate in project directories.
What Should Happen?
This appears to be a regression from the original issue #8856, where files were created in /tmp/claude-*-cwd. Now they are created directly in the working directory with a different naming pattern (tmpclaude-*-cwd).
Error Messages/Logs
Steps to Reproduce
- Start Claude Code in a project directory
- Execute several bash commands
- Check the working directory for
tmpclaude-*-cwdfiles
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
72 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Additional reproduction data:
tmpclaude-*-cwdfiles%TEMP%)/d/repos/organization/pot/pineapple)Timestamps show files created throughout the session (19:08-21:31) correlating with Bash tool invocations. Files persist after session ends.
This appears to be the same root cause as #8856 (missing
unlinkSyncafter reading the temp file), with the Windows variant incorrectly placing files in CWD instead of the system temp directory.https://github.com/anthropics/claude-code/issues/17568#issuecomment-3736945382
<img width="845" height="316" alt="Image" src="https://github.com/user-attachments/assets/b7774bb8-363d-4879-a6b8-8bd9e91d5f93" /> even a empty directory will creat these rubish
I am also experiencing this
<img width="301" height="255" alt="Image" src="https://github.com/user-attachments/assets/b094636f-476e-454a-96b5-71284fe6b8e3" />
I am also experiencing same really annoying
yes, same issue.
Same issue here
+1
+1
+1
+1
+1
+1
PS C:\Users\USER\DIR_FHE> ls .\tmpclaude-*-cwd ; git status -s
Directory: C:\Users\USER\DIR_FHE
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2026-01-12 14:22 30 tmpclaude-020b-cwd
-a---- 2026-01-12 14:22 30 tmpclaude-06ae-cwd
-a---- 2026-01-12 15:20 30 tmpclaude-0903-cwd
-a---- 2026-01-12 14:43 30 tmpclaude-0d70-cwd
-a---- 2026-01-12 14:35 30 tmpclaude-149c-cwd
-a---- 2026-01-12 14:44 30 tmpclaude-25d9-cwd
-a---- 2026-01-12 15:57 30 tmpclaude-2630-cwd
-a---- 2026-01-12 14:33 30 tmpclaude-2787-cwd
-a---- 2026-01-12 15:31 30 tmpclaude-324f-cwd
-a---- 2026-01-12 14:33 30 tmpclaude-32b3-cwd
-a---- 2026-01-12 14:43 30 tmpclaude-41fa-cwd
-a---- 2026-01-12 15:31 30 tmpclaude-4e36-cwd
-a---- 2026-01-12 14:41 30 tmpclaude-69e6-cwd
-a---- 2026-01-12 14:31 30 tmpclaude-6cf5-cwd
-a---- 2026-01-12 14:26 30 tmpclaude-779d-cwd
-a---- 2026-01-12 14:43 30 tmpclaude-7ad2-cwd
-a---- 2026-01-12 14:41 30 tmpclaude-828f-cwd
-a---- 2026-01-12 15:53 30 tmpclaude-8de4-cwd
-a---- 2026-01-12 15:20 30 tmpclaude-97cb-cwd
-a---- 2026-01-12 14:26 30 tmpclaude-9c5a-cwd
-a---- 2026-01-12 14:43 30 tmpclaude-b4a6-cwd
-a---- 2026-01-12 14:31 30 tmpclaude-c026-cwd
-a---- 2026-01-12 14:41 30 tmpclaude-cdc3-cwd
-a---- 2026-01-12 14:34 30 tmpclaude-dc22-cwd
-a---- 2026-01-12 14:43 30 tmpclaude-e9ed-cwd
-a---- 2026-01-12 14:43 30 tmpclaude-f4c4-cwd
?? tmpclaude-020b-cwd
?? tmpclaude-06ae-cwd
?? tmpclaude-0903-cwd
?? tmpclaude-0d70-cwd
?? tmpclaude-149c-cwd
?? tmpclaude-25d9-cwd
?? tmpclaude-2630-cwd
?? tmpclaude-2787-cwd
?? tmpclaude-324f-cwd
?? tmpclaude-32b3-cwd
?? tmpclaude-41fa-cwd
?? tmpclaude-4e36-cwd
?? tmpclaude-69e6-cwd
?? tmpclaude-6cf5-cwd
?? tmpclaude-779d-cwd
?? tmpclaude-7ad2-cwd
?? tmpclaude-828f-cwd
?? tmpclaude-8de4-cwd
?? tmpclaude-97cb-cwd
?? tmpclaude-9c5a-cwd
?? tmpclaude-b4a6-cwd
?? tmpclaude-c026-cwd
?? tmpclaude-cdc3-cwd
?? tmpclaude-dc22-cwd
?? tmpclaude-e9ed-cwd
?? tmpclaude-f4c4-cwd
Confirming this issue on Windows 11 with Claude Code 2.1.5.
Additional observation: Setting
CLAUDE_CODE_TMPDIRenvironment variable (added in 2.1.5 per the changelog) does NOT redirect these-cwdfiles. They continue to be created in the project's working directory regardless of the env var setting.Workaround: Adding
tmpclaude-*to.gitignorehides them from git status, but doesn't prevent their creation in the project directory.+1
+1
+1
+1
Additional reproduction data:
Claude Code version: 2.1.5
OS: Windows 11
Model: Tried on other model such as GLM 4.7
So i believe this is pure claude code issue.
Still an issue with Claude 2.1.6
+1
+1
<img width="277" height="269" alt="Image" src="https://github.com/user-attachments/assets/093652d5-0944-4a13-901d-77dbf9db81a5" />
补充,很多时候会产生 空的 nul 文件,他甚至不能删除
<img width="1542" height="672" alt="Image" src="https://github.com/user-attachments/assets/e5e79499-adb2-4485-a7b6-4b0aec025117" />
我上面发了个脚本 修补此问题
+1 不但有这个cwd 还有nul无法删除的文件
+1
+1
<img width="841" height="733" alt="Image" src="https://github.com/user-attachments/assets/262c5fa6-0585-4973-ad75-af50e38e6aca" />
回收站已经满了
Temp Solution: https://linux.do/t/topic/1431488
+1
+1
+1
same issue
<img width="224" height="364" alt="Image" src="https://github.com/user-attachments/assets/d859c425-6e22-4e6f-b3df-b4c863a25767" />
+1 Confirming this issue on Windows 11.
Found 47
tmpclaude-*-cwdfiles accumulated across my project directories. Files persist after Claude Code sessions end and show as untracked in git.Also found a
nulfile created in the working directory (related issue mentioned above).Workaround:
find . -name 'tmpclaude-*-cwd' -delete+1
<img width="513" height="1215" alt="Image" src="https://github.com/user-attachments/assets/f25acb1b-9ce6-4223-abfc-a2848286bbc9" />
+1 Confirming this issue on Windows 11.
+1
Same issue on windows 11. Had claude version 2.0.76 have now upgraded to 2.1.6 both versions exhibited the problem.
+1
Same problem
same problem
same
+1
+1
+1
+1
+1 version 2.1.7, windows 11
+1 same
+1. Same, but only in my C# project. All others do not have this issue yet.
+1
+1 same
+1 same on my machine
v2.1.7 已修复..
yes
Also have this issue. Windows 11 - 2.1.7 (Claude Code)
Hi! If it's still happening to you, do you mind sharing a screenshot of your claude --version number and the path of these tmp files? New files should be properly handled but you may need to manually delete the old tmp files.
@timgu0 Same issue here - this is getting out of control
Environment:
Expected behavior:
Temporary working directory marker files should be created in:
C:\Users\raul_\AppData\Local\Temp\claude\c--Users-raul--Dealy\
Actual behavior:
Files are created in project root:
C:\Users\raul_\Dealy\tmpclaude-{hex}-cwd
Added to .gitignore to avoid polluting my repo but it's still polluting my project's directory tree
EDIT: Just updated my version to 2.1.7 and bug is still not resolved
<img width="608" height="336" alt="Image" src="https://github.com/user-attachments/assets/ff09ff17-cb97-42aa-8dfd-43d76d58b25d" />
))
any fix for this yet?
Confirming on Windows 11 + Git Bash with Claude Code v2.1.7.
Found 9
tmpclaude-*-cwdfiles in my working directory after a session. All contain Unix-style paths:Files are 59 bytes each and persist after session ends.
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.
@timgu0 - any ETA from your end guys to resolve this ? Cheers
Seeing the same issue
<img width="681" height="490" alt="Image" src="https://github.com/user-attachments/assets/c9e4e62b-45af-4c47-8f93-83dc9f080a37" />
Also happening in VS Code with Claude agent handoff.
It's also happening when GitHub Copilot delegate sessions to Claude Code in VS Code.
Will be fixed in an upcoming release!
@ashwin-ant - could you use a different pattern when closing bugs? First make a release, then populate the changelog, linking to this issue, and write a comment in the issue so people can test the change?
@marcindulak I'll leave this open until the fix is released.
@ashwin-ant Do you know when the new release will arrive? And is there a manual fix for this?
@ashwin-ant
this fix seems to move everything to a /tmp directory. this behavoir is SUBSTANTIALLY WORSE if you use VMs heavily as it leaves the git system and will be lost when you change machines.
Also, the heavy usage of the MEMORY.md files from ~/.claude also introduces significant problems between VMs. I have to completely disable the memory system and rewire the tmp file usage for any meaningful work across multiple machines
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.