[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" />

View original on GitHub ↗

48 Comments

lhj6102 · 6 months ago

Having same issue.

<img width="318" height="287" alt="Image" src="https://github.com/user-attachments/assets/4d0554e7-8ce5-4b05-af9e-dc010e216671" />

BenGardiner123 · 6 months ago

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" />

ProductOfAmerica · 6 months ago

Same....

HarryVu176 · 6 months ago

Yep! Got the same issue, not sure why

yemangran · 6 months ago

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

ImTheSpyke · 6 months ago

Same here ✋
Running Sonnet model

<img width="203" height="246" alt="Image" src="https://github.com/user-attachments/assets/63a88696-31b9-4e3d-b63d-f9102239d0c4" />

Haleclipse · 6 months ago

fix script: https://gist.github.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b

  irm "https://gist.githubusercontent.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b/raw/apply-claude-code-windows-path-fix-2.1.5.ps1" -OutFile "apply-claude-code-windows-path-fix-2.1.5.ps1"
  .\apply-claude-code-windows-path-fix-2.1.5.ps1

or

irm "https://gist.githubusercontent.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b/raw/apply-claude-code-windows-path-fix-2.1.5.ps1" | iex
deloz · 6 months ago

<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。

luweiming · 6 months ago

same here on windows. it's making claude code unusable for tonight, many manual clean-ups

nielsNocore · 6 months ago

same here on windows.

kbecking · 6 months ago

Same issue

LemonBF · 6 months ago

+1

Butanium · 6 months ago

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

Butanium · 6 months ago

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=

Haleclipse · 6 months ago
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?

s1495k043 · 6 months ago

It's really sad, I can't even temporarily switch to OpenCode now.

nikitakot · 6 months ago

rollback to the older version helps

$ claude install stable
s1495k043 · 6 months ago
rollback to the older version helps `` $ claude install stable ``
 $ claude install stable --force

It's work

GaLzZy · 6 months ago
fix script: https://gist.github.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b `` irm "https://gist.githubusercontent.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b/raw/apply-claude-code-windows-path-fix-2.1.5.ps1" -OutFile "apply-claude-code-windows-path-fix-2.1.5.ps1" .\apply-claude-code-windows-path-fix-2.1.5.ps1 ` or ` irm "https://gist.githubusercontent.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b/raw/apply-claude-code-windows-path-fix-2.1.5.ps1" | iex ``

Didn't work for me it says Claude Code cli.js not found or something

Haleclipse · 6 months ago
> fix script: https://gist.github.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b > `` > irm "https://gist.githubusercontent.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b/raw/apply-claude-code-windows-path-fix-2.1.5.ps1" -OutFile "apply-claude-code-windows-path-fix-2.1.5.ps1" > .\apply-claude-code-windows-path-fix-2.1.5.ps1 > ` > > > > > > > > > > > > or > ` > irm "https://gist.githubusercontent.com/Haleclipse/1c35fe7b98fe1b5ea0523eb4d3a10f0b/raw/apply-claude-code-windows-path-fix-2.1.5.ps1" | iex > `` 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.

ScoDev1 · 6 months ago

same issue here.

clafollett · 6 months ago

Just ran the update from 2.1.2 to 2.1.5 and experienced this issue immediately after updating.

davidrimshnick · 6 months ago

Additional Technical Details

Observed behavior:

  • Every Bash tool invocation creates a tmpclaude-XXXX-cwd file in the working directory
  • File contains just the current working directory path

Root cause identified:
Claude Code appends this to every bash command:

pwd -P >| \tmp\claude-XXXX-cwd

The backslash path \tmp\claude is being mangled - the \t appears to be interpreted/stripped, resulting in tmpclaude written to the CWD instead of /tmp/claude-XXXX-cwd.

Reproduction:

  • Windows 11 with Git Bash
  • Claude Code 2.1.5 (appears to be a regression in this version)
  • Working directory on H: drive (network/mapped drive), though may affect C: drive as well

Workaround:
Added tmpclaude* to .gitignore to prevent them from being tracked.

Process evidence:

wmic process get commandline | grep claude

Shows the bash wrapper command with the problematic \tmp\claude-XXXX-cwd path.

amorriscode contributor · 6 months ago

Sorry about that folks, I have a fix up for this.

luweiming · 6 months ago

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" />

HarryVu176 · 6 months ago

@amorriscode still happening for me too, 2.1.5 windows 11

WangShiSoftware · 6 months ago

<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

Settings:  Status   Config   Usage  (←/→ or tab to cycle)

  Version: 2.1.5
  Session name: /rename to add a name
  Session ID: c4c05b09-...
  cwd: E:\project\...
  Login method: Claude Pro Account
  ......

  Model: opus (claude-opus-4-5-20251101)
davidrimshnick · 6 months ago

Will be updated in next patch

On Mon, Jan 12, 2026 at 8:29 PM 广州王石软件 @.***> wrote:

WangShiSoftware left a comment (anthropics/claude-code#17568) <https://github.com/anthropics/claude-code/issues/17568#issuecomment-3741355772> default.png (view on web) <https://github.com/user-attachments/assets/3333756b-26ca-4b40-97bb-8460c6833cf7> Yeah, Same here on Windows 10 Settings: Status Config Usage (←/→ or tab to cycle) Version: 2.1.5 Session name: /rename to add a name Session ID: c4c05b09-... cwd: E:\project\... Login method: Claude Pro Account ...... Model: opus (claude-opus-4-5-20251101) — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/17568#issuecomment-3741355772>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABBNXX745UV5372TRVJ7GQD4GRC6NAVCNFSM6AAAAACRLQ74YOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONBRGM2TKNZXGI> . You are receiving this because you commented.Message ID: @.***>
oroalej · 6 months ago

FYI, still not fixed in v2.1.6

davidrimshnick · 6 months ago

Same, still broken for me

On Tue, Jan 13, 2026 at 8:45 AM oroalej @.***> wrote:

oroalej left a comment (anthropics/claude-code#17568) <https://github.com/anthropics/claude-code/issues/17568#issuecomment-3744418990> FYI, still not fixed in v2.1.6 — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/17568#issuecomment-3744418990>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABBNXX73ETBZSXF4LCYELBD4GTZHNAVCNFSM6AAAAACRLQ74YOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONBUGQYTQOJZGA> . You are receiving this because you commented.Message ID: @.***>
projectkindred11 · 6 months ago

Same, still broken.

polajenko · 6 months ago

still broken

samarsheikh001 · 6 months ago

this should be a hotfix

AnthonyDreams · 6 months ago

still broken

BOLT04 · 6 months ago
FYI, still not fixed in v2.1.6

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...

phenrickson · 6 months ago

why do these issues keep getting closed when there is no resolution?

Haleclipse · 6 months ago
why do these issues keep getting closed when there is no resolution?

Because 2.1.7 has already been fixed.

1 hour ago

marskingx · 6 months ago

我在wsl環境沒問題,結果今天把環境換到powershell也一樣遇到了

Kiyozz · 6 months ago

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

ProductOfAmerica · 6 months ago
2.1.7 still creates tmp files in the project (I'm using Powershell). Sometimes, it even creates a file named nul.

nul file is because it outputs to null and you're on windows not linux... e.g. /dev/null 2>&1 has nothing to do with this problem.

Kiyozz · 6 months ago
> 2.1.7 still creates tmp files in the project (I'm using Powershell). > Sometimes, it even creates a file named nul. nul file is because it outputs to null and you're on windows not linux... e.g. /dev/null 2>&1 has 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 contributor · 6 months ago

@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.

marcindulak · 6 months ago
@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" />

BaptisteJosh · 6 months ago

Also this still is broken in 2.1.7 for me, windows machine

2915049204 · 6 months ago
@amorriscode各位,不好意思啊,这个问题在 PR 合并时自动关闭了,但修复要到下一个 Claude Code 版本发布才会生效。这个 bug 已经在 2.1.7 版本里修好啦。

My version is 2.1.7, but it still creates files in the project directory

paulogarbo · 6 months ago

I'm having the same issue on Windows 11 with Claude Code 2.1.7

konamgil · 5 months ago

same....

github-actions[bot] · 5 months ago

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.