Scratchpad temp dir hardcoded to /private/tmp, ignores $TMPDIR, no config override
Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 17, 2026
Description
Claude Code creates per-session scratchpad directories at:
/private/tmp/claude-503/<escaped-cwd>/<session-id>/scratchpad
one per project working directory, and these are never automatically cleaned up.
Issues found
$TMPDIR(the standard macOS per-user temp directory, e.g./var/folders/.../T/) is set correctly in the shell environment, but is not consulted when constructing the scratchpad path. Confirmed noclaude-503directory exists anywhere under$TMPDIR— the path is hardcoded to/private/tmpregardless.- Checked the full
settings.jsonschema — there is noscratchpadDirectorykey or equivalent. Nothing in theenvblock redirects it either, since path construction doesn't readTMPDIRin the first place. - Scratchpad directories accumulate indefinitely (found 4 project dirs, ~7MB, some multiple days old) with no automatic cleanup based on age.
Request
- Honor
$TMPDIRwhen present (standard OS behavior on macOS/Linux), or - Add a
scratchpadDirectory(or similar) key tosettings.jsonso users can redirect this path (e.g. to~/tmp), and/or - Auto-clean stale session scratchpad directories after some configurable age.
Environment
- Platform: macOS (Darwin 24.6.0)
- Shell: fish
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗