[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:

  1. Start Claude Code in a project directory.
  2. Perform tasks (e.g., editing files or running commands).
  3. 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_

View original on GitHub ↗

19 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/17635
  2. https://github.com/anthropics/claude-code/issues/17600
  3. https://github.com/anthropics/claude-code/issues/17609

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

elfenlieds7 · 6 months ago

Same issue here on Windows 11 with Claude Code.

Every Bash tool invocation creates a new tmpclaude-XXXX-cwd file 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 .gitignore to prevent git pollution, but the files keep piling up in the filesystem.

+1 for fixing this - it's a bit annoying on Windows.

joe-watkins · 6 months ago

Same here on Windows with CLI! I'll stop yelling at poor Claude now ;)

RobertHauta-Davinci · 6 months ago

Same Issue my entire software team is experiencing this on windows now.

dancingmadkefka · 6 months ago

Just started getting this issue since a few hours.

sannge · 6 months ago

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

sbrockway · 6 months ago

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

cgaravitoq · 6 months ago

Rolling back worked for me too! 👍🏼

gipoezcan · 6 months ago

still happening on 2.1.6

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

I thought npm is deprecated - or does that install native by default now?

stevebeauge · 6 months ago
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.

Varietyz · 6 months ago

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.md and paste it into Claude Code. Claude will configure everything automatically.

What It Does

  • Session Start Cleanup: Runs automatically when you start Claude Code
  • On-Save Cleanup: (Optional) Runs on every file save in VSCode
  • Cross-Platform: Works on Linux, macOS, Windows
  • Git Ignore: Prevents temp files from showing in git status

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

sbrockway · 6 months ago

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.

RobertHauta · 6 months ago

This is fixed bro, 2.1.7 came out yesterday and they have stopped appearing

demigodmode · 5 months ago

@RobertHauta i had this exact issue in 2.1.7, albeit it was the latest release not tagged as stable at that time.

yurukusa · 3 months ago

/tmp/issue-17636-answer.md

claude[bot] contributor · 2 months ago

This is a duplicate of #17600, which was fixed as of version 2.1.47.

github-actions[bot] · 2 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.