[BUG] Excessive tmpclaude-*-cwd temporary files being created in working directory

Resolved 💬 5 comments Opened Jan 12, 2026 by vtsappsteam Closed Apr 18, 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?

Since a recent update, Claude Code is creating multiple tmpclaude-XXXX-cwd temporary files in the working directory during normal usage. These files appear to be created on almost every command/interaction.

Environment:

  • OS: Windows 10/11
  • Claude Code version: (latest)
  • Shell: Git Bash / PowerShell

Steps to reproduce:

  1. Open Claude Code in a project directory
  2. Execute several commands (e.g., read files, run bash commands)
  3. Check the working directory

Expected behavior:
Temporary files should be cleaned up automatically after use, or stored in a system temp directory instead of the project folder.

Actual behavior:
Multiple tmpclaude-*-cwd files accumulate in the working directory:
tmpclaude-0148-cwd
tmpclaude-0b14-cwd
tmpclaude-131b-cwd
tmpclaude-817f-cwd
...

Each file contains the current working directory path (~42 bytes).

Workaround:
Adding tmpclaude-* to .gitignore prevents them from being tracked, but they still clutter the directory.

What Should Happen?

Suggestion:
These files should either be:

  1. Created in system temp directory ($TMPDIR or %TEMP%)
  2. Automatically cleaned up after each command
  3. Or stored in a hidden .claude folder

Error Messages/Logs

Steps to Reproduce

Steps to reproduce:

  1. Open terminal and navigate to any project directory
  2. Start Claude Code by running claude
  3. Ask Claude to clone a git repository:

"clone repo from https://github.com/example/repo.git"

  1. Ask Claude to read a file:

"read the package.json file"

  1. Ask Claude to run a bash command:

"run ls -la"

  1. After 3-5 interactions, run ls tmpclaude* in the project directory
  2. Observe multiple tmpclaude-XXXX-cwd files have been created and not cleaned up

Frequency: Files are created on nearly every tool invocation (Bash, Read, etc.), not just once per session.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.5

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

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