{"name":"CLAUDE_CODE_BASE_REF","slug":"claude-code-base-ref","family":"env","title":"Environment variables","noun":"environment variable","description":"Git ref Claude Code diffs against when it attaches per-file diffs to Write and Edit tool results (in remote sessions with `CLAUDE_CODE_REMOTE` set, or bridge sessions with the `tengu_bridge_child_tool_diff` flag on, default `true`) and when it computes a branch-point diff of the repository. The base is `git merge-base HEAD <ref>`; unset, Claude Code uses the repository's default branch instead, and a value starting with `-` is ignored (the tool-result diff falls back to `HEAD`, the branch-point diff to uncommitted changes only). A matching entry in `CLAUDE_CODE_BASE_REFS` takes precedence, and Claude Code's bridge clears this variable from the environment of the sessions it spawns.","description_source":"code","described_by":{"bundle":"2.1.286","author":"claude-opus-5-5"},"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":null},"aliases":[],"entries":[],"entries_total":0,"docs":[],"docs_total":0,"gates":[],"related":[{"name":"CLAUDE_CODE_BASE_REFS","slug":"claude-code-base-refs","description":"Map from checkout name to git ref, keyed like `CLAUDE_CODE_REPO_CHECKOUTS` (checkout name to path); entries whose value is not a string are dropped, and a parse failure is logged and leaves the map empty. When Claude Code computes a Write or Edit diff for a file inside a listed checkout, that checkout's ref is used as the diff base in place of `CLAUDE_CODE_BASE_REF`. It is parsed once per session, and Claude Code's bridge clears it from the environment of the sessions it spawns."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/claude-code-base-ref","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}