Follow Discord
Sweep 06 Nov 2026 · 01:32Z Build v2.1.319 537 read Stable v2.1.311 Latest v2.1.318 Next v2.1.319 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.277 ·

Sandboxed commands get a fallback TMPDIR when needed but unset

Sandboxed shell commands that reference TMPDIR but don't have it set now get a computed fallback value exported automatically

Group of 2 You'll notice Bug Fixes
JSON All of v2.1.277
You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
SandboxArea: what it touches
Bug FixesKind: in v2.1.277,
Bug FixesSection of the release

What

When Claude Code builds a sandboxed shell command, if sandboxing is enabled and the command text references the literal string TMPDIR but no explicit sandbox tmp-dir override exists, it now computes a fallback tmp-dir value (called tmpDirBackstop) and passes it through when building the command.

That value is then used in the generated shell preamble: if tmpDirBackstop is set, the shell setup exports TMPDIR from it, but only if TMPDIR isn't already set in the environment.

Why

This prevents commands that rely on TMPDIR from breaking inside a sandbox where that variable might otherwise be unset, without overriding a TMPDIR the environment already provides.

Read from
Names in the bundleTMPDIR
Since it was published

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 since A 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-environments see the edit
Confirmed since Anthropic's documentation has since written up TMPDIR, on Explore the .claude directory. | `image-cache/<session>/` | Attached images saved by Claude Code v2.1.274 and earlier. Later versions save pasted and attached images outside `~/.claude`, in an `images/` directory for each session under the temp directory that [`CLAUDE_C… claude-directory see the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up TMPDIR, on Explore the .claude directory.
Anthropic's release notes agreeFixed $TMPDIR expanding empty in Bash commands that run outside the sandbox while sandboxing is enabled

See this entry in the whole of v2.1.277 →

Feedback