[BUG] Bash tool leaves tmpclaude-*-cwd files uncleaned on Windows/Git Bash

Resolved 💬 2 comments Opened Jan 12, 2026 by jpeggdev Closed Jan 12, 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?

Every Bash command executed through Claude Code creates a tmpclaude-*-cwd file that is never cleaned up. These 20-byte files accumulate rapidly and can fill up the filesystem.

Files persist indefinitely. Each Bash command creates a new 20-byte file containing the current working directory path (e.g., /c/Code/pegg.family).

What Should Happen?

Temporary working directory tracking files should be cleaned up after command execution completes.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Execute any Bash command through Claude Code
  2. Check the project root directory
  3. Observe tmpclaude-[random-hex]-cwd files are created
  4. Execute more commands - more files accumulate
  5. Files are never cleaned up

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 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Title:
Bash tool leaves tmpclaude-*-cwd files uncleaned on Windows/Git Bash

Description/Body:
## Bug Description
Every Bash command executed through Claude Code creates a tmpclaude-*-cwd file that is never cleaned up. These 20-byte files accumulate rapidly and can fill up the filesystem.

## Environment

  • OS: Windows 10.0-26200 (MINGW64_NT-10.0-26200 3.6.5-22c95533.x86_64)
  • Shell: Git Bash (MINGW64)
  • IDE: VSCode
  • Claude Code Version: [your version - check with claude --version]

## Steps to Reproduce

  1. Open a project directory in VSCode with Claude Code
  2. Execute any Bash command through Claude Code
  3. Check the project root directory
  4. Observe tmpclaude-[random-hex]-cwd files are created
  5. Execute more commands - more files accumulate
  6. Files are never cleaned up

## Expected Behavior
Temporary working directory tracking files should be cleaned up after command execution completes.

## Actual Behavior
Files persist indefinitely. Each Bash command creates a new 20-byte file containing the current working directory path (e.g., /c/Code/pegg.family).

## Example
$ ls -lh tmpclaude-*-cwd
-rw-r--r-- 1 user 197121 20 Jan 11 20:04 tmpclaude-3195-cwd
-rw-r--r-- 1 user 197121 20 Jan 11 20:04 tmpclaude-4b36-cwd
-rw-r--r-- 1 user 197121 20 Jan 11 20:04 tmpclaude-63b4-cwd
...

$ cat tmpclaude-63b4-cwd
/c/Code/pegg.family

## Impact

  • Filesystem pollution
  • Can fill up disk space with intensive Claude Code usage
  • Clutters git status
  • Started appearing recently (Jan 11, 2026)

## Temporary Workaround
Added to .gitignore:
tmpclaude-*-cwd

Periodic cleanup:
```bash
find . -name "tmpclaude-*-cwd" -type f -delete

View original on GitHub ↗

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