Temporary tmpclaude-*-cwd files created in project root instead of system temp directory
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code creates temporary files named tmpclaude-*-cwd (e.g., tmpclaude-0117-cwd, tmpclaude-03ed-cwd) in the project's working directory. These files appear to track the current working directory for subprocesses/agents.
Problems:
- Files pollute the project root directory
- They show up as untracked files in
git status - Multiple files accumulate over sessions (20+ files observed)
- Files are small (~17 bytes) but clutter the workspace and distract from actual changed files
What Should Happen?
These temporary files should be created in the system temp directory (%TEMP% on Windows, /tmp on Unix) rather than the user's project directory. Alternatively, they should be cleaned up automatically when the session ends.
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code session in any project directory
- Use features that spawn subagents (e.g., Task tool with Explore agent, or run
/init) - Check the project root with
ls -laor view in file explorer - Observe
tmpclaude-*-cwdfiles appearing in the project root
Claude Model
Opus 4.5
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.2 (Claude Code)
Claude Code Version
2.1.6 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell 7
Additional Information
This bug report was submitted via Browser MCP and Claude Code - demonstrating the tool's capability to interact with web forms while also ironically reporting an issue with the tool itself.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗