Temporary files (tmpclaude-*-cwd) created in project directory instead of scratchpad

Resolved 💬 2 comments Opened Jan 14, 2026 by fernandoxavier02 Closed Feb 27, 2026

Description

Claude Code creates temporary files with pattern tmpclaude-*-cwd in the user's project working directory instead of the designated scratchpad directory.

Current Behavior

When running Claude Code, files like tmpclaude-fe6b-cwd, tmpclaude-5204-cwd, etc. are created in:

  • Project root directory (e.g., d:\Rhema App\)
  • Subdirectories where bash commands are executed (e.g., d:\Rhema App\functions\)

These files accumulate over time (100+ files in my case) and clutter the project directory.

Expected Behavior

These temporary files should be created in the scratchpad directory that Claude Code already defines:

  • Windows: %TEMP%\claude\{project-hash}\{session-id}\scratchpad\
  • Example: C:\Users\win\AppData\Local\Temp\claude\d--Rhema-App\0e2459b9-3549-4685-b4b1-5e1e8810abdc\scratchpad

Workaround

Currently mitigated by:

  1. Adding tmpclaude-*-cwd to .gitignore
  2. Manually deleting files: rm -f tmpclaude-*-cwd

Environment

  • OS: Windows 11
  • Claude Code: Latest version (VSCode extension)

Impact

  • Clutters project directory
  • Confuses users who see unknown files appearing
  • Files not automatically cleaned up between sessions

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗