{"name":"CLAUDE_CODE_HOST_WORKTREE","slug":"claude-code-host-worktree","family":"env","title":"Environment variables","noun":"environment variable","description":"Two new environment variables let an embedding app block file writes inside chosen paths, except inside one declared worktree","description_source":"entry","described_by":{"version":"2.1.288","anchor":"host-set-worktree-fence-env-vars-now-enforced-on-file-writes"},"presence":{"first_seen":"2.1.288","removed_in":null,"in_current_build":true,"newest_mined":"2.1.288","builds":1,"mined_builds":131,"first_cited":null},"aliases":[],"entries":[{"version":"2.1.288","anchor":"host-set-worktree-fence-env-vars-now-enforced-on-file-writes","heading":"Host apps can fence off folders so file tools write only to a worktree","line":"Two new environment variables let an embedding app block file writes inside chosen paths, except inside one declared worktree","released_at":"2026-10-02 18:30:40","reason":"found in this entry's text, named in this entry"}],"entries_total":1,"docs":[],"docs_total":0,"gates":[],"related":[{"name":"CLAUDE_CODE_HOST_AUTH_ENV_VAR","slug":"claude-code-host-auth-env-var","description":"Names the environment variable that holds a credential supplied by the host application that launched Claude Code. Any non-empty value marks the provider as host-managed, the same as a set `ANTHROPIC_UNIX_SOCKET` or a true `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, and the named variable is then removed from the environment of processes Claude Code spawns. A value naming `ANTHROPIC_UNIX_SOCKET`, `CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST`, this variable itself or another built-in provider variable is not treated as a credential name."},{"name":"CLAUDE_CODE_HOST_AUTH_REFRESH_TIMEOUT_MS","slug":"claude-code-host-auth-refresh-timeout-ms","description":"Milliseconds Claude Code waits for the SDK host to answer a `host_auth_token_refresh` control request, used by the refresh hook registered when `CLAUDE_CODE_SDK_HAS_HOST_AUTH_REFRESH` is set. Default `30000`; an unset, empty, `0` or non-numeric value uses the default."},{"name":"CLAUDE_CODE_HOST_CREDS_FILE","slug":"claude-code-host-creds-file","description":"A trailing slash in your host credentials file path no longer changes whether the rule matches."},{"name":"CLAUDE_CODE_HOST_GATEWAY_LINEAGE","slug":"claude-code-host-gateway-lineage","description":"New CLAUDE_CODE_HOST_GATEWAY_LINEAGE variable keeps child processes of a Desktop-hosted gateway session treated as host-managed"},{"name":"CLAUDE_CODE_HOST_PLATFORM","slug":"claude-code-host-platform","description":"A value of `win32`, `darwin` or `linux` replaces the real `process.platform` as the `platform` Claude Code reports alongside its version and account ids and in its environment details; any other value falls back to the real platform. The raw value is also reported as `platformRaw` (`linux` when unset) and read as the `hostPlatform` fact during environment detection."},{"name":"CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD","slug":"claude-code-host-prompt-supersedes-record","description":"`CLAUDE_CODE_HOST_PROMPT_SUPERSEDES_RECORD`, `CLAUDE_CODE_MCP_SERVE_SETTINGS` and `CLAUDE_CODE_DISABLE_WEB_FETCH` are now passed along"},{"name":"CLAUDE_CODE_HOST_SCHEDULED_RUN","slug":"claude-code-host-scheduled-run","description":"Scheduled-run tasks can now report why they fired, but only if the host explicitly opts in via CLAUDE_CODE_HOST_SCHEDULED_RUN=1"},{"name":"CLAUDE_CODE_HOST_SESSION_ID","slug":"claude-code-host-session-id","description":"Claude Code now recognizes a CLAUDE_CODE_HOST_SESSION_ID environment variable"},{"name":"CLAUDE_CODE_HOST_WORKTREE_FENCE","slug":"claude-code-host-worktree-fence","description":"Two new environment variables let an embedding app block file writes inside chosen paths, except inside one declared worktree"}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-host-worktree","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}