Temporary files (tmpclaude-*-cwd) not cleaned up after bash commands

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Jan 13, 2026 · closed Jan 13, 2026

Description

Claude Code creates temporary files named tmpclaude-<hash>-cwd in the working directory when executing bash commands. These files contain the current working directory path and appear to be used for tracking directory state.

The files are not being cleaned up after the bash commands complete, leaving orphaned temp files in the user's project directory.

Steps to Reproduce

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

Observed Behavior

Multiple temp files accumulate in the working directory:

-rw-r--r-- 1 user 34 Jan 13 18:46 tmpclaude-0701-cwd
-rw-r--r-- 1 user 34 Jan 13 18:46 tmpclaude-1fab-cwd
-rw-r--r-- 1 user 34 Jan 13 18:56 tmpclaude-3300-cwd
...

Each file contains just the working directory path, e.g.:

/d/repos/my-project

Expected Behavior

Temporary files should be cleaned up after the bash command completes, or stored in a system temp directory rather than the user's project directory.

Environment

  • Platform: Windows (MINGW64_NT-10.0)
  • Claude Code: Latest version as of 2026-01-13

View original on GitHub ↗

4 Comments

ksons · 9 months ago

Additional context: Claude Code is running inside Windows Git Bash (MINGW64). This might be relevant since the temp file handling could behave differently in this environment compared to native Windows cmd/PowerShell or Unix shells.

ksons · 9 months ago

Duplicate of #17568

Matteo-stefaa · 9 months ago

It was fixed this morning in v2.1.7
Now it's working fine 🙌

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.