[Bug] Temporary tmpclaude-*-cwd files not cleaned up after session end
Description:
Claude Code creates tmpclaude-XXXX-cwd files to track shell working directory state, but never cleans them up. They accumulate over time in the project directory.
Repro:
- Use Claude Code with Bash commands across multiple sessions
- Observe tmpclaude-*-cwd files accumulating in the working directory
Expected: Temp files cleaned up on session end or startup
Actual: Files persist indefinitely, requiring manual cleanup
Workaround: find . -name 'tmpclaude-*-cwd' -delete
Environment Info
- Platform: win32
- Terminal: null
- Version: 2.1.5
- Feedback ID: ec4c7ec7-a6d3-4f85-9b07-8c4a9f7ded7b
same. just updated to 2.1.5 on windows 11, now every bash command creates a tmpclaude-XXXX-cwd file and leaves it in my project directory. what a mess... sigh...
Same here. Really disappointing to see the release quality sometimes ... introducing CLAUDE_CODE_TMPDIR and then causing this issue :-(
This issue has been confirmed here #17568
same issue here
also unable to drag and drop files into message box using shift anymore in code claude ui...used to work just fine
Temporary Workaround: Automated Cleanup
I've created an automated solution that cleans up these temp files automatically: tmpclaude-auto-cleanup
Quick Setup (30 seconds)
Just copy the prompt from CLAUDE_PROMPT.md and paste it into Claude Code. Claude will configure everything automatically.
What It Does
- ✅ Session Start Cleanup: Runs automatically when you start Claude Code
- ✅ On-Save Cleanup: (Optional) Runs on every file save in VSCode
- ✅ Cross-Platform: Works on Linux, macOS, Windows
- ✅ Git Ignore: Prevents temp files from showing in
git status
Manual Setup
Full instructions and manual configuration files available in the repo.
Note: This is a workaround until the core issue is fixed in Claude Code CLI. The real bug still needs to be addressed by Anthropic.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.