Bug: tmpclaude-*-cwd temp files accumulate in project root (Windows)

Resolved 💬 4 comments Opened Jan 12, 2026 by rubrical-worker Closed Jan 12, 2026

Description

Claude Code is creating temporary files named tmpclaude-{hash}-cwd in the project root directory. These files are not being cleaned up when shell sessions end, causing them to accumulate.

Files Created

tmpclaude-a78a-cwd
tmpclaude-72cc-cwd
tmpclaude-2fe9-cwd
tmpclaude-db54-cwd

Each file contains only the current working directory path (e.g., /e/Projects/idpf-praxis).

Steps to Reproduce

  1. Open Claude Code on Windows
  2. Claude will run several Bash commands during a session
  3. Check the project root directory for tmpclaude-* files

Expected Behavior

  • Temporary files should be cleaned up when the shell session ends, OR
  • Temporary files should be created in a system temp directory (e.g., $TEMP or /tmp), not the project root

Actual Behavior

  • Multiple tmpclaude-{hash}-cwd files accumulate in the project root
  • Files persist after the session ends
  • Files appear as untracked in git status

Environment

  • OS: Windows 10/11
  • Shell: Git Bash
  • Claude Code Version: Latest (as of January 12, 2026)

Workaround

Add tmpclaude-* to .gitignore to prevent git status clutter:

echo "tmpclaude-*" >> .gitignore

Suggested Fix

  1. Create these files in a system temp directory instead of the project root
  2. Implement cleanup logic when shell sessions terminate
  3. Use a single file per Claude Code instance rather than per-subprocess

View original on GitHub ↗

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