claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

tmpclaude-*-cwd temp files not cleaned up on Windows after bash commands

Open indexfull opened this issue 1 month ago • 3 comments

Description

Claude Code creates temporary files (tmpclaude-XXXX-cwd) in the working directory to track the current working directory for bash command execution. These files are not being cleaned up after commands complete on Windows.

Environment

  • OS: Windows (win32)
  • Shell: Git Bash
  • Claude Code version: current (as of Jan 2025)

Steps to Reproduce

  1. Run Claude Code on Windows
  2. Execute several bash commands during a session
  3. Check the working directory for tmpclaude-* files

Observed Behavior

Multiple temp files accumulate in the project directory:

-rw-r--r-- 1 user 197609 46 Jan 12 19:05 tmpclaude-108f-cwd
-rw-r--r-- 1 user 197609 46 Jan 12 19:13 tmpclaude-295d-cwd
-rw-r--r-- 1 user 197609 46 Jan 12 19:00 tmpclaude-3006-cwd
... (18+ files in one session)

Each file is 46 bytes containing the Git Bash-style working directory path:

/c/Users/username/Documents/Project

Expected Behavior

These temp files should be deleted after bash command execution completes.

Likely Cause

The cleanup code may not be handling Windows path conversion properly (Windows C:\... vs Git Bash /c/...), or the cleanup hook isn't being triggered.

Workaround

Add tmpclaude-* to .gitignore and periodically delete manually.

indexfull avatar Jan 12 '26 18:01 indexfull