Scratchpad directory under /tmp is erased on reboot (systemd-tmpfiles); system prompt gives no volatility warning — a full day of pipeline output lost
Summary
The system prompt tells the model to use a session-specific scratchpad directory for all temporary files, and that directory lives under /tmp. On a standard Debian/Ubuntu-style system systemd-tmpfiles ships D /tmp 1777 root root 30d, which erases /tmp on every boot. Nothing in the system prompt or the docs warns that the scratchpad is volatile across reboots.
In a long-running session (data-generation pipeline for an LLM fine-tuning dataset, ~24 h of wall-clock work, tens of thousands of API calls across several paid providers), the host rebooted and the entire scratchpad was gone: all generated data, all review verdicts, all pipeline scripts, the Python venv, and every background job launched from it. Nothing was recoverable from inside the container.
Environment
- Claude Code 2.1.260, Linux (LXC container, Proxmox host), bash
- Scratchpad path pattern:
/tmp/claude-0/<project-slug>/<session-id>/scratchpad /usr/lib/tmpfiles.d/tmp.conf:D /tmp 1777 root root 30d
Steps to reproduce
- Start a session; follow the system prompt's instruction to keep all working files in the scratchpad directory.
- Run a multi-hour pipeline that writes its outputs there (and launches background workers with
setsid nohup). - Reboot the host.
- The scratchpad directory is recreated empty; all data and processes are gone.
Expected
One or more of:
- The scratchpad should default to a location that survives reboots (e.g. under
~/.claude/or$XDG_STATE_HOME), or Claude Code should create it with atmpfiles.dexclusion (x /tmp/claude-0). - At minimum, the system prompt should state explicitly that the scratchpad is volatile and erased on reboot, so that the model copies long-running outputs somewhere persistent. The current wording ("Use this directory for ALL temporary file needs … intermediate results … outputs") actively steers the model into keeping multi-hour work there.
- Optionally, a warning in the UI when a session's scratchpad exceeds some size or age.
Impact
Loss of roughly one day of generation and review work and the associated provider credits. The model followed the system prompt's instruction; the instruction itself was the hazard.
No secrets, credentials, hostnames or proprietary content are included in this report. Session reference available on request.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗