Preflight Checklist
Problem Statement
Claude Code's scratchpad directory (e.g., /tmp/claude/<encoded-cwd>/<session-id>/scratchpad/) has two fundamental design issues:
1. Visibility: When a user says "write a draft and I'll review it", Claude writes to the scratchpad. But the scratchpad is inside /tmp, which is:
- Not easily accessible on many setups (e.g., Dev Containers, remote environments)
- Requires the user to understand Claude Code's internal directory structure
The user has to know about scratchpad, know it's in /tmp, and explicitly say "write to a project directory instead". This defeats the purpose of an LLM tool that should infer user intent.
2. Persistence: Scratchpad is in /tmp, which is volatile:
- Dev Container restart = gone
- OS reboot = gone
- tmpfs expiration = gone
This matters because LLM outputs are non-deterministic. Unlike script outputs that can be regenerated, LLM artifacts are one-of-a-kind. Losing them means re-spending API tokens for a potentially different result.
Key insight: Scratchpad is fundamentally different from transcripts.
- Transcripts: Raw logs, primarily for debugging/auditing. Volatility is acceptable.
- Scratchpad: Intentional artifacts that humans review, iterate on, and verify. Should persist.
Proposed Solution
-
Make scratchpad location configurable via:
- CLI flag or environment variable, AND/OR
CLAUDE.md / settings.json
-
Document the scratchpad behavior clearly:
- Where it lives by default
- How to change it
- What gets written there
-
Move default location out of /tmp:
~/.claude/scratchpad/ or similar
- At minimum, respect
$TMPDIR / $CLAUDE_CODE_TMPDIR
Alternative Solutions
Current workaround: Explicitly instruct Claude to write to a project directory instead of scratchpad. This requires knowing the internal behavior, which most users shouldn't need to.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
- User: "Write a document summarizing Git/GitHub procedures for Claude Code to follow. I'll review it before we finalize."
- Claude writes to
/tmp/claude/.../scratchpad/git-procedures.md
- Claude: "Done! I've written the document."
- User: "...where? I don't see it in my project."
- User has to either:
- Ask Claude to
cat the file (wastes context)
- Navigate to the scratchpad path manually (requires knowing the internal structure)
- Ask Claude to copy it to the project (extra step that shouldn't be needed)
Expected: When the user says "I'll review it", Claude should write to a location the user can easily access.
Additional Context
Related issues that focus on /tmp path conflicts but not the persistence/visibility problem:
This issue focuses on the design rationale: scratchpad artifacts should be treated as valuable, human-reviewable outputs—not throwaway temp files.
✍️ Author: Claude Code (Dev Container) with @carrotRakko
Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.
Preflight Checklist
Problem Statement
Claude Code's scratchpad directory (e.g.,
/tmp/claude/<encoded-cwd>/<session-id>/scratchpad/) has two fundamental design issues:1. Visibility: When a user says "write a draft and I'll review it", Claude writes to the scratchpad. But the scratchpad is inside
/tmp, which is:The user has to know about scratchpad, know it's in
/tmp, and explicitly say "write to a project directory instead". This defeats the purpose of an LLM tool that should infer user intent.2. Persistence: Scratchpad is in
/tmp, which is volatile:This matters because LLM outputs are non-deterministic. Unlike script outputs that can be regenerated, LLM artifacts are one-of-a-kind. Losing them means re-spending API tokens for a potentially different result.
Key insight: Scratchpad is fundamentally different from transcripts.
Proposed Solution
Make scratchpad location configurable via:
CLAUDE.md/ settings.jsonDocument the scratchpad behavior clearly:
Move default location out of
/tmp:~/.claude/scratchpad/or similar$TMPDIR/$CLAUDE_CODE_TMPDIRAlternative Solutions
Current workaround: Explicitly instruct Claude to write to a project directory instead of scratchpad. This requires knowing the internal behavior, which most users shouldn't need to.
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
/tmp/claude/.../scratchpad/git-procedures.mdcatthe file (wastes context)Expected: When the user says "I'll review it", Claude should write to a location the user can easily access.
Additional Context
Related issues that focus on
/tmppath conflicts but not the persistence/visibility problem:This issue focuses on the design rationale: scratchpad artifacts should be treated as valuable, human-reviewable outputs—not throwaway temp files.
✍️ Author: Claude Code (Dev Container) with @carrotRakko
Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.