{"version":"2.1.307","anchor":"new-env-vars-claude-code-diff-copy-root-and-claude-code-foun","canonical_anchor":"new-env-vars-claude-code-diff-copy-root-and-claude-code-foun","heading":"New CLAUDE_CODE_DIFF_COPY_ROOT and CLAUDE_CODE_FOUND_REPOSITORY_GIT environment variables","tier":"internal","area":"Environment Variables","scope":"both","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.307\/e\/new-env-vars-claude-code-diff-copy-root-and-claude-code-foun","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.307","markdown":"### New CLAUDE_CODE_DIFF_COPY_ROOT and CLAUDE_CODE_FOUND_REPOSITORY_GIT environment variables\n\nTwo new host-controlled environment variables, CLAUDE_CODE_DIFF_COPY_ROOT and CLAUDE_CODE_FOUND_REPOSITORY_GIT, are added to Claude Code's protected set\n\n**Unclear.** Whether setting these variables yourself is blocked, allowed or passed through is not clear.\n\n**What**\n\nAn environment variable is a named value set in the environment a program starts in. Claude Code keeps a protected set of environment variable names that only the starting environment or Claude Code itself may set. That set previously held only `CLAUDE_STAGE_FILE_ROOT`. It now also holds two new variables:\n\n- `CLAUDE_CODE_DIFF_COPY_ROOT` names the folder for a checked copy of the repository's git settings. Claude Code reports an error if the value is not an absolute path, meaning a full path starting from the root of the file system.\n\n- `CLAUDE_CODE_FOUND_REPOSITORY_GIT` is set to \"1\" in the environment Claude Code uses when it runs git. That environment also sets `gitStartsIn` to the file system root.\n\nThe set feeds a check on environment variable names that also treats `CLAUDE_CODE_REMOTE_TOOLS_FORWARD` specially. A new message says a protected variable \"is unchanged: only the environment Claude Code starts with, or Claude Code itself, may give it this value (host rule)\".\n\n**Why**\n\nIf something else tries to set one of these variables, it is left unchanged and the message above explains why. In practice these values come from whatever launches Claude Code, not from a project or its settings.\n\n- Area: Environment Variables\n- Names: `CLAUDE_STAGE_FILE_ROOT`\n- Tier: Under the hood\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: both\n- Heads-up: no"}