Temporary tmpclaude-*-cwd files accumulate in working directory
Resolved 💬 4 comments Opened Jan 12, 2026 by theodari Closed Jan 16, 2026
Description
Claude Code creates temporary files named tmpclaude-XXXX-cwd in the current working directory to track the working directory of bash sessions. These files accumulate over time and are not cleaned up when sessions end.
Problem
- Files created in wrong location: These temp files are created in the user's working directory instead of a proper temp folder (like
$TMPDIR,/tmp, or%TEMP%) - No automatic cleanup: The files persist after sessions end, leading to accumulation
- Pollutes project directories: Users end up with dozens of these files in their project folders
Example
After a few hours of use:
$ ls tmpclaude-*-cwd | wc -l
39
Each file contains only the working directory path:
$ cat tmpclaude-00e2-cwd
/c/Users/theod/Documents/DATA/QtProjects
Expected behavior
- These temporary files should be created in the system's temp directory
- They should be automatically cleaned up when a bash session ends
- Alternatively, use a different mechanism that doesn't require creating files in the working directory
Environment
- OS: Windows 11
- Shell: Git Bash (default in Claude Code on Windows)
- Claude Code version: Latest (January 2025)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗