{"name":"CLAUDE_CODE_SHELL_PREFIX","slug":"claude-code-shell-prefix","family":"env","title":"Environment variables","noun":"environment variable","description":"Hooks now run with the shell prefix and environment of whichever side made the call.","description_source":"entry","described_by":{"version":"2.1.246","anchor":"hooks-run-under-the-calling-side-s-shell-prefix-and-environm"},"presence":{"first_seen":"2.1.138","removed_in":null,"in_current_build":true,"newest_mined":"2.1.308","builds":149,"mined_builds":149,"first_cited":{"version":"2.1.247","released_at":"2026-08-26 18:02:01","spans":5}},"aliases":[],"entries":[{"version":"2.1.301","anchor":"mcp-stdio-spawn-takes-its-shell-prefix-and-base-env-through","heading":"How local MCP servers get their shell prefix and environment has changed","line":"For MCP servers started as local programs, the shell prefix and starting environment are now worked out in one place and adjusted by config scope","released_at":"2026-10-15 14:34:23","reason":"found in this entry's text, named in this entry"},{"version":"2.1.301","anchor":"org-hooks-claude-code-shell-prefix-and-inherited-env-now-co","heading":"Simpler check for which hooks get the organization's shell prefix","line":"Whether a hook counts as your organization's, and so gets CLAUDE_CODE_SHELL_PREFIX, no longer depends on the hook's type or its plugin","released_at":"2026-10-15 14:34:23","reason":"found in this entry's text, named in this entry"},{"version":"2.1.299","anchor":"hook-spawn-cloud-sessions-without-a-disk-and-shell-prefix-h","heading":"Hooks that can't run in cloud sessions now say why","line":"Hooks that can't run in a cloud session or fail on another machine now return a clear reason, and shell prefix handling for plugin and skill hooks changed","released_at":"2026-10-14 00:23:19","reason":"found in this entry's text"},{"version":"2.1.288","anchor":"hook-registration-failure-reasons-dot-folder-shell-prefix","heading":"Claude Code says why a hook was not registered","line":"Hooks that are skipped now come with a reason, such as a missing script or a script in an unread dot-folder","released_at":"2026-10-02 18:30:40","reason":"found in this entry's text, named in this entry"},{"version":"2.1.288","anchor":"cloud-hook-forwarding-notices-rewritten-and-held-hooks-gain","heading":"Shorter reasons when a hook is not sent to a cloud session","line":"With `claude --cloud`, notices about hooks held back are shorter and give a cause, with a warning when a changed guard hook blocks tool calls","released_at":"2026-10-02 18:30:40","reason":"found in this entry's text"},{"version":"2.1.281","anchor":"cloud-device-hooks-claude-code-shell-prefix-and-writable-ro","heading":"Cloud device hooks: CLAUDE_CODE_SHELL_PREFIX and writable-root checks now understand Windows paths","line":"Checks on CLAUDE_CODE_SHELL_PREFIX for cloud device hooks now understand Windows paths","released_at":"2026-09-23 17:01:17","reason":"found in this entry's text, named in this entry"},{"version":"2.1.248","anchor":"ink-app-shell-mcp-client-and-skill-tool-moved-to-top-level-d","heading":"Ink app shell, MCP client and Skill tool moved to top-level definitions","line":"The Ink shell, MCP client and Skill tool are now defined at load time.","released_at":"2026-08-27 20:35:36","reason":"found in this entry's text"},{"version":"2.1.247","anchor":"hook-inventory-sent-to-a-cloud-worker-includes-the-repo-root","heading":"Hook inventory sent to a cloud worker includes the repo root","line":"The hook list sent to a cloud session now includes your repo root and a composed shell prefix.","released_at":"2026-08-26 18:02:01","reason":"named in this entry, found in this entry's text"},{"version":"2.1.247","anchor":"device-hooks-get-a-full-child-environment-and-an-untrustwort","heading":"Device hooks get a full child environment, and an untrustworthy shell prefix is dropped","line":"Hooks run for cloud sessions get a full environment, and an untrusted CLAUDE_CODE_SHELL_PREFIX is dropped with a warning.","released_at":"2026-08-26 18:02:01","reason":"named in this entry, found in this entry's text"},{"version":"2.1.247","anchor":"stricter-vetting-of-hooks-forwarded-to-a-cloud-session","heading":"Stricter vetting of hooks forwarded to a cloud session","line":"Hooks forwarded to a cloud session are vetted harder, and refused if their program lives somewhere the session can write.","released_at":"2026-08-26 18:02:01","reason":"found in this entry's text"}],"entries_total":12,"docs":[{"source":"claude-code","path":"corporate-launcher","title":"Run Claude Code behind a corporate launcher","documented":false}],"docs_total":1,"gates":[],"related":[{"name":"CLAUDE_CODE_SHELL","slug":"claude-code-shell","description":"Shell for Claude Code to run commands in, overriding shell detection. The path must contain `bash` or `zsh` and pass Claude Code's shell check; otherwise it logs `is not a valid bash\/zsh path, falling back to detection` and detects a shell from `SHELL` and the usual install directories. Bash tool telemetry records whether it is set as `executor_shell_overridden`."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-shell-prefix","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}