Skip to content

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

Description

@fernandoxavier02

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions