Temporary files not cleaned up on Windows (tmpclaude-*-cwd, nul)
Resolved 💬 9 comments Opened Jan 13, 2026 by bbscout Closed Feb 27, 2026
Bug Description
Claude Code leaves temporary files in the working directory on Windows that are not cleaned up after use.
Files affected
tmpclaude-XXXX-cwd- Multiple files containing the current working directory pathnul- File created when output is redirected to NUL (Windows null device) via bash
Environment
- Claude Code version: 2.1.6
- OS: Windows 10/11
- Shell: Git Bash / MinGW (used by Claude Code)
Steps to reproduce
- Start Claude Code in any directory on Windows
- Work with it for a while (run some commands)
- Close/restart Claude Code
- Check the working directory - temp files remain
Expected behavior
Temporary files should be automatically deleted when no longer needed.
Additional context
The nul file issue occurs because bash interprets > nul as a file path rather than the Windows NUL device. The redirect should use > /dev/null or > NUL: on Windows.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗