tmpclaude-*-cwd temporary files are not cleaned up automatically
Status Closed — duplicate
Maintainer reply ✓ Yes — claude[bot]
Workaround ✓ Mentioned in description ↑
Activity 11 comments · opened Jan 12, 2026 · closed Apr 26, 2026
💡 Likely answer: A maintainer (claude[bot], contributor)
responded on this thread — see the highlighted reply below.
Description
Claude Code creates temporary files named tmpclaude-XXXX-cwd in the working directory, but these files are not automatically cleaned up after the session ends or when they are no longer needed.
Steps to Reproduce
- Use Claude Code in a project directory
- Perform various operations (file reading, editing, bash commands, etc.)
- End the session or let some time pass
- Check the working directory
Expected Behavior
Temporary files should be automatically cleaned up when:
- The Claude Code session ends
- The temporary file is no longer needed
- Or at minimum, they should be created in a system temp directory instead of the working directory
Actual Behavior
Temporary files accumulate in the working directory. In my case, I found 56 tmpclaude-*-cwd files in my project directory.
tmpclaude-0003-cwd tmpclaude-39be-cwd tmpclaude-86bb-cwd tmpclaude-cfc8-cwd
tmpclaude-0e34-cwd tmpclaude-3cdd-cwd tmpclaude-8962-cwd tmpclaude-d45a-cwd
tmpclaude-19e3-cwd tmpclaude-41be-cwd tmpclaude-9074-cwd tmpclaude-d592-cwd
... (56 files total)
Environment
- OS: Windows 11
- Claude Code Version: Latest (via VSCode extension)
Suggested Solutions
- Automatic cleanup: Delete temp files when the session ends or when they become stale
- Use system temp directory: Create these files in
%TEMP%or/tmpinstead of the working directory - Add to default .gitignore: At minimum, document that users should add
tmpclaude-*to their.gitignore
Workaround
Manually delete with:
# Windows
del tmpclaude-*-cwd
# Unix
rm tmpclaude-*-cwd
Or add to .gitignore:
tmpclaude-*
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
same issue in Windows 11 with Windows Terminal
https://github.com/anthropics/claude-code/issues/17568#issuecomment-3736945382
this is super annoying... another bug that seems to have entered this codebase, I never saw the files
tmpclaudebefore 😟same issue here - hoping support sees this
same issue here
same issue in win10
<img width="320" height="730" alt="Image" src="https://github.com/user-attachments/assets/052c740c-684b-4123-a889-8f4b58ca05dc" />
same issue in Win 10
A Stop hook can clean these up at session end:
Only deletes files older than 60 minutes to avoid affecting active sessions.
Install:
Same solution as in #8856.
This is a duplicate of #17600, which was fixed as of version 2.1.47.
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.