Windows: tmpclaude-*-cwd temp files not being cleaned up

Resolved 💬 4 comments Opened Jan 17, 2026 by Baesic-Project-Manager Closed Feb 27, 2026

Description

Claude Code is creating tmpclaude-XXXX-cwd temporary files in the working directory but not cleaning them up when sessions end. These files accumulate rapidly on Windows.

Environment

  • OS: Windows 10/11 (MSYS/Git Bash)
  • Claude Code version: Latest (as of Jan 2025)

Steps to Reproduce

  1. Run Claude Code from any directory on Windows
  2. End the session normally
  3. Check the directory - tmpclaude-XXXX-cwd files remain

Observed Behavior

  • ~500 temp files accumulated over ~2 days of normal usage
  • Files are 1KB each, named tmpclaude-XXXX-cwd (where XXXX is a hex string)
  • Files are created in whatever directory Claude Code is launched from
  • Files are NOT cleaned up when sessions end
  • New files created with each session

Expected Behavior

These temp files should be automatically deleted when the Claude Code session ends, or should be created in a proper temp directory (%TEMP%) rather than the working directory.

Impact

At the rate of accumulation (~70+ files per day with moderate usage), this quickly clutters working directories and requires manual cleanup.

Workaround

Manual cleanup with:

find /path -name "tmpclaude-*-cwd" -type f -exec rm {} \;

Additional Context

This appears to be Windows-specific - the cleanup mechanism that likely works on macOS/Linux may be failing silently on Windows due to path handling differences or file locking behavior.

View original on GitHub ↗

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