[BUG] [Bug] tmpclaude-*-cwd temp files created in project directory instead of system temp (Windows)

Resolved 💬 3 comments Opened Feb 2, 2026 by MuhammadLuqman-99 Closed Feb 5, 2026

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

Claude Code creates tmpclaude-*-cwd temporary files directly in the project/working directory instead of the system temp folder (%TEMP%). These files accumulate and clutter the project folder.

Environment

  • Claude Code version: 2.0.69
  • OS: Windows 10/11
  • IDE: VSCode Extension

Steps to Reproduce

  1. Open a project folder in VSCode with Claude Code extension
  2. Run any bash command through Claude Code
  3. Check the project root folder

Expected Behavior

Temp files should be created in the system temp directory (%TEMP% or C:\Users\<user>\AppData\Local\Temp)

Actual Behavior

Files like tmpclaude-f9c0-cwd, tmpclaude-8250-cwd are created in the project directory. Each file contains just the working directory path.

Workaround

Added to .gitignore:
tmpclaude-*

And .vscode/settings.json:

{
  "files.exclude": {
    "**/tmpclaude-*": true
  }
}

### What Should Happen?

Claude Code should create temporary files (tmpclaude-*-cwd) in the system temp directory (%TEMP% or /tmp) instead of the user's project folder. Temp files should be automatically cleaned up when the session ends.


### Error Messages/Logs

```shell
No error - but files accumulate in project directory:
$ ls tmpclaude-*
tmpclaude-8250-cwd
tmpclaude-f9c0-cwd
tmpclaude-3f77-cwd
... (20+ files after a few sessions)

File content example:
$ cat tmpclaude-8250-cwd
/c/Users/desa murni/Desktop/Ads-Analytic

Steps to Reproduce

  1. Open any project folder in VSCode with Claude Code extension on Windows
  2. Start a Claude Code session
  3. Run any bash command (e.g., ls, git status)
  4. Check the project root directory in Windows Explorer
  5. Notice tmpclaude-XXXX-cwd files appearing
  6. End the session - files remain
  7. Start new sessions - more files accumulate

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Unknown (noticed after recent updates)

Claude Code Version

2.0.69 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

  • Files contain the current working directory path
  • Created for each bash command execution
  • Not cleaned up on session end
  • Workaround: Add tmpclaude-* to .gitignore and VSCode files.exclude
  • Expected location: %TEMP% folder or C:\Users\<user>\AppData\Local\Temp
  • Environment shows TEMP=/tmp (Unix style) which may be the root cause on Windows

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗