claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Windows: tmpclaude-*-cwd files created in CWD instead of %TEMP%

Open jasonftl opened this issue 10 months ago • 19 comments

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

Image

jasonftl avatar Jan 11 '26 23:01 jasonftl

Having same issue.

Image

lhj6102 avatar Jan 12 '26 00:01 lhj6102

same issue here on Windows in VSCode using Claude Code v2.1.5

Image

BenGardiner123 avatar Jan 12 '26 01:01 BenGardiner123

Same....

ProductOfAmerica avatar Jan 12 '26 02:01 ProductOfAmerica

Yep! Got the same issue, not sure why

HarryVu176 avatar Jan 12 '26 02:01 HarryVu176

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

yemangran avatar Jan 12 '26 03:01 yemangran

Same here ✋ Running Sonnet model

Image

ImTheSpyke avatar Jan 12 '26 04:01 ImTheSpyke

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

Haleclipse avatar Jan 12 '26 05:01 Haleclipse

Image

Windows same, and I add tmpclaude-* to .gitignore。

deloz avatar Jan 12 '26 05:01 deloz

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

luweiming avatar Jan 12 '26 05:01 luweiming

same here on windows.

nielsNocore avatar Jan 12 '26 10:01 nielsNocore

Same issue

kbecking avatar Jan 12 '26 10:01 kbecking

+1

LemonBF avatar Jan 12 '26 10:01 LemonBF

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 avatar Jan 12 '26 10:01 Butanium

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=

Butanium avatar Jan 12 '26 11:01 Butanium

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?

Haleclipse avatar Jan 12 '26 12:01 Haleclipse

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

s1495k043 avatar Jan 12 '26 12:01 s1495k043

rollback to the older version helps

$ claude install stable

nikitakot avatar Jan 12 '26 12:01 nikitakot

rollback to the older version helps

$ claude install stable
 $ claude install stable --force

It's work

s1495k043 avatar Jan 12 '26 12:01 s1495k043

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

GaLzZy avatar Jan 12 '26 13:01 GaLzZy

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.

Haleclipse avatar Jan 12 '26 14:01 Haleclipse