Files
Trevin Chow a2c9866ceb fix(scratch): fall back to $TMPDIR when /tmp cannot host the scratch root
Under Claude Code's macOS sandbox only $TMPDIR (/tmp/claude-<uid>) is
writable, so every skill's cross-invocation scratch setup aborted with
"Operation not permitted" at /tmp/compound-engineering-<uid>. #1305 fixed
the per-run mktemp forms and deferred this durable root.

Every shell preamble, the six identical peer-job-runner.py copies, and
ce-work's unit_workspace_state.py now probe the /tmp root (creatable,
not a symlink, owned, writable) and otherwise use
${TMPDIR:-/tmp}/compound-engineering-<uid>, in the same order, so later
invocations resolve the same root. Writability is probed with [ -w ] /
os.access because a pre-existing root passes mkdir -p and chmod under
the sandbox yet refuses the first inner write. Unsandboxed behavior is
unchanged. ce-handoff resume enumerates both candidate roots.

Fixes #1294

Claude-Session: https://claude.ai/code/session_014wod7UqLtRtt91osnKtydm
2026-08-15 15:39:07 -07:00
..