Bash tool creates tmpclaude*-cwd temp files in working directory

Resolved 💬 8 comments Opened Jan 13, 2026 by drpolygon Closed Feb 28, 2026

Description

The Bash tool creates temporary files named tmpclaude-XXXX-cwd in the current working directory. These files appear to be used for tracking the working directory between commands, but they are not cleaned up after each command and accumulate in the user's project directory.

Steps to Reproduce

  1. Run any Bash command through Claude Code
  2. Check the working directory - a tmpclaude-XXXX-cwd file will be created

Expected Behavior

  • Temp files should be created in the system temp directory (e.g., $TMPDIR, /tmp, or %TEMP%), not the user's working directory
  • Temp files should be cleaned up after use

Actual Behavior

  • Multiple tmpclaude*-cwd files accumulate in the working directory
  • Files are small (24 bytes) and contain the current working directory path
  • Files persist after commands complete

Environment

  • Platform: Windows 10
  • Shell: Git Bash

Example

$ ls -la tmpclaude*
-rw-r--r-- 1 User 197609 24 Jan 13 13:32 tmpclaude-c74c-cwd
-rw-r--r-- 1 User 197609 24 Jan 13 13:32 tmpclaude-cb3b-cwd
-rw-r--r-- 1 User 197609 24 Jan 13 13:32 tmpclaude-e05f-cwd
-rw-r--r-- 1 User 197609 24 Jan 13 13:32 tmpclaude-f005-cwd

View original on GitHub ↗

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