{"version":"2.1.277","anchor":"sandboxbash-env-gains-a-tmpdir-backstop","canonical_anchor":"sandboxed-shell-commands-get-a-tmpdir-backstop-when-referen","heading":"Sandboxed commands get a fallback TMPDIR when needed but unset","tier":"notice","area":"Sandbox","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.277\/e\/sandboxbash-env-gains-a-tmpdir-backstop","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.277","markdown":"### Sandboxed commands get a fallback TMPDIR when needed but unset\n\nSandboxed shell commands that reference TMPDIR but don't have it set now get a computed fallback value exported automatically\n\n**What**\n\nWhen 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.\n\nThat 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.\n\n**Why**\n\nThis 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.\n\n- Area: Sandbox\n- Names: `TMPDIR`\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5"}