[BUG] Windows: tmpclaude-*-cwd files created in CWD instead of %TEMP%
Resolved 💬 48 comments Opened Jan 11, 2026 by jasonftl Closed Jan 12, 2026
💡 Likely answer: A maintainer (amorriscode, 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?
Temporary tmpclaude-XXXX-cwd files used for working directory tracking are being created in the current working directory.
What Should Happen?
These files should not be created in the CWD as they interfere with git tracking.
Perhaps instead they should be in the system temp folder (%TEMP%) or the .claude directory in %USERPROFILE%
Error Messages/Logs
N/A
Steps to Reproduce
Launch Claude Code from a git repository on Windows
Run any bash commands
Observe tmpclaude-*-cwd files appearing in the repo root
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.4
Claude Code Version
2.1.5
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
<img width="295" height="114" alt="Image" src="https://github.com/user-attachments/assets/3c55eae2-8491-4ef5-9b35-9609ecd9d6e8" />
48 Comments
Having same issue.
<img width="318" height="287" alt="Image" src="https://github.com/user-attachments/assets/4d0554e7-8ce5-4b05-af9e-dc010e216671" />
same issue here on Windows in VSCode using Claude Code v2.1.5
<img width="302" height="64" alt="Image" src="https://github.com/user-attachments/assets/0a6d0988-88a0-48c1-a074-4049aab98b07" />
Same....
Yep! Got the same issue, not sure why
I also encountered the same issue. I'm using IDEA 2024.3.7, Claude plugin 0.1.14-beta, and Claude Code CLI 2.1.5
Same here ✋
Running Sonnet model
<img width="203" height="246" alt="Image" src="https://github.com/user-attachments/assets/63a88696-31b9-4e3d-b63d-f9102239d0c4" />
fix script: https://gist.github.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b
or
<img width="233" height="170" alt="Image" src="https://github.com/user-attachments/assets/44f9b671-d38c-43d5-82f6-0870eea2c003" />
Windows same, and I add
tmpclaude-*to .gitignore。same here on windows. it's making claude code unusable for tonight, many manual clean-ups
same here on windows.
Same issue
+1
As I assume the claude team will look at this issue, PLEASE also fix this related tmpdir issue: https://github.com/anthropics/claude-code/issues/15700
I suspect you can fix this by having this env variable set to your tmp although i didn't try it yet
export CLAUDE_CODE_TMPDIR=
Actually, this is a path conversion issue, not a problem with the path itself.
And I’ve already provided the fix earlier.
Why does it seem like none of you can see it?
It's really sad, I can't even temporarily switch to OpenCode now.
rollback to the older version helps
It's work
Didn't work for me it says Claude Code cli.js not found or something
If you’re using the bun version of Claude Code, this won’t work for you. please use the npm package version instead.
If you’re using the npm package version of Claude Code,
you can also adjust the scan path specified at the beginning of the script yourself.
same issue here.
Just ran the update from 2.1.2 to 2.1.5 and experienced this issue immediately after updating.
Additional Technical Details
Observed behavior:
tmpclaude-XXXX-cwdfile in the working directoryRoot cause identified:
Claude Code appends this to every bash command:
The backslash path
\tmp\claudeis being mangled - the\tappears to be interpreted/stripped, resulting intmpclaudewritten to the CWD instead of/tmp/claude-XXXX-cwd.Reproduction:
Workaround:
Added
tmpclaude*to.gitignoreto prevent them from being tracked.Process evidence:
Shows the bash wrapper command with the problematic
\tmp\claude-XXXX-cwdpath.Sorry about that folks, I have a fix up for this.
Hi @amorriscode , it's still happening for some reasons. i'm on windows 11, claude 2.1.5
<img width="289" height="174" alt="Image" src="https://github.com/user-attachments/assets/6978be15-3e08-40d0-b46b-42dbb16403c2" />
@amorriscode still happening for me too, 2.1.5 windows 11
<img width="769" height="188" alt="Image" src="https://github.com/user-attachments/assets/3333756b-26ca-4b40-97bb-8460c6833cf7" />
Yeah, Same here on Windows 10
Will be updated in next patch
On Mon, Jan 12, 2026 at 8:29 PM 广州王石软件 @.***> wrote:
FYI, still not fixed in v2.1.6
Same, still broken for me
On Tue, Jan 13, 2026 at 8:45 AM oroalej @.***> wrote:
Same, still broken.
still broken
this should be a hotfix
still broken
sorry @amorriscode , I didn't understand why this issue was closed. I have this version and it's also broken for me, which is a bit annoying 😟. Could you share if your patch is planned for the next weeks?
It's sad to see "shipping fast" be more important than quality software, I really like claude code...
why do these issues keep getting closed when there is no resolution?
Because 2.1.7 has already been fixed.
1 hour ago
我在wsl環境沒問題,結果今天把環境換到powershell也一樣遇到了
2.1.7 still creates tmp files in the project (I'm using Powershell).
Sometimes, it even creates a file named
nul.EDIT: after a major testing, I din't had any new tmp file. Fixed for me
nulfile is because it outputs to null and you're on windows not linux... e.g./dev/null 2>&1has nothing to do with this problem.Then, there is an issue somewhere in Claude’s code that tries to use Linux syntax on Windows, right?
@amorriscode sorry folks, the issue got auto-merged when the PR was merged but the fix doesn't go out until the following Claude Code release. This was fixed in
2.1.7.@amorriscode - the issue looks like closed by you, as a person, in https://github.com/anthropics/claude-code/issues/17568#issuecomment-3740527447 https://github.com/anthropics/claude-code/issues/17568#event-22000218933
It does not look like auto-closed by a bot, unless I'm wrong by looking at the appearance.
Could you provide more details so the release process will be better understood in the future?
<img width="1216" height="423" alt="Image" src="https://github.com/user-attachments/assets/76d06fc1-419e-4968-a7c7-0d22ac3fc28a" />
Also this still is broken in
2.1.7for me, windows machineMy version is 2.1.7, but it still creates files in the project directory
I'm having the same issue on Windows 11 with Claude Code 2.1.7
same....
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.