You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
SandboxArea: what it touches
ImprovementsKind: in v2.1.281,
ImprovementsSection of the release
What
A sandbox is a restricted space that limits what a command Claude runs can touch. When a command runs in the sandbox and the sandbox has its own temporary folder (sandboxTmpDir), Claude Code now sets TMPDIR to that folder on macOS and Linux before the command starts. TMPDIR is the setting programs read to decide where to put temporary files.
Before this, temporary-folder variables were set this way only on Windows.
Why
Programs run in the sandbox on macOS and Linux now write their temporary files into the sandbox's own temporary folder, as they already did on Windows.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Added sinceA small documentation edit on Choose a sandbox environment touched a line naming TMPDIR after this was published.* The directory where Claude Code writes runtime files. Unless you set [`CLAUDE_CODE_TMPDIR`](/docs/en/env-vars), that directory is:sandbox-environmentssee the edit
Confirmed sinceAnthropic's documentation has since written up TMPDIR, on Choose a permission mode.| A shell variable followed by one common top-level directory name, such as `mnt`, `tmp`, `usr`, or `Users` | `rm -rf "$TMPDIR/mnt"` | When the variable expands empty, the command removes `/mnt` |permission-modessee the edit
How sure we are
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up TMPDIR, on Choose a permission mode.