{"name":"GIT_DIR","slug":"git-dir","family":"env","title":"Environment variables","noun":"environment variable","description":"Stray git environment variables in your shell can no longer misdirect worktree operations.","description_source":"entry","described_by":{"version":"2.1.222","anchor":"worktree-git-commands-run-with-a-scrubbed-git-environment"},"presence":{"first_seen":null,"removed_in":null,"in_current_build":false,"newest_mined":"2.1.309","builds":0,"mined_builds":150,"first_cited":{"version":"2.1.271","released_at":"2026-09-14 19:45:19","spans":1}},"aliases":[],"entries":[{"version":"2.1.309","anchor":"worktree-git-guard-handling-of-variable-assignments-before","heading":"Worktree isolation checks variables set before git commands differently","line":"The worktree guard now treats variable assignments placed before a git command differently, which appears to tighten what it allows","released_at":"2026-10-22 20:34:13","reason":"found in this entry's text"},{"version":"2.1.307","anchor":"diff-copy-of-nested-git-repos-hardened","heading":"Safer copying of nested git repositories when comparing changes","line":"When copying a git repository nested inside your project to compare changes, Claude Code now checks the copy harder and refuses mismatched work trees","released_at":"2026-10-21 20:47:18","reason":"found in this entry's text"},{"version":"2.1.275","anchor":"git-related-environment-variables-and-cli-flags-now-get-patt","heading":"Git-related environment variables and CLI flags now get pattern-matched for hardening","line":"Claude Code now scans environment variables and git flags for tricks that redirect where git actually operates","released_at":"2026-09-17 20:20:31","reason":"found in this entry's text"},{"version":"2.1.239","anchor":"directory-sync-places-files-without-following-symlinks-and-t","heading":"Directory sync places files without following symlinks, and tells you when it can't","line":"Cloud file sync writes through directory handles so a swapped symlink can't redirect it, and says when that's unavailable.","released_at":"2026-08-21 17:18:54","reason":"found in this entry's text"},{"version":"2.1.234","anchor":"git-subprocesses-get-a-more-thorough-environment-scrub","heading":"Git subprocesses get a more thorough environment scrub","line":"Your shell's git environment variables are scrubbed more thoroughly before Claude Code runs git.","released_at":"2026-08-17 18:19:13","reason":"found in this entry's text"},{"version":"2.1.222","anchor":"worktree-git-commands-run-with-a-scrubbed-git-environment","heading":"Worktree git commands run with a scrubbed git environment","line":"Stray git environment variables in your shell can no longer misdirect worktree operations.","released_at":"2026-08-04 20:37:17","reason":"named in this entry, found in this entry's text"},{"version":"2.1.222","anchor":"git-invocations-hardened-with-sanitized-args-and-environment","heading":"Git invocations hardened with sanitized args and environment","line":"Many more git commands now run with a scrubbed environment so stray variables can't redirect them.","released_at":"2026-08-04 20:37:17","reason":"named in this entry, found in this entry's text"}],"entries_total":7,"docs":[{"source":"claude-code","path":"worktrees","title":"Run parallel sessions with worktrees","documented":false}],"docs_total":1,"gates":[],"related":[{"name":"GIT_ALLOW_PROTOCOL","slug":"git-allow-protocol","description":"Git subprocesses now block graft files as an extra hardening measure"},{"name":"GIT_ASKPASS","slug":"git-askpass","description":"Git commands no longer hang forever on a Windows credential manager popup."},{"name":"GIT_CONFIG","slug":"git-config","description":"Claude inspects a synced checkout's git config first and refuses to run git there if it looks unsafe."},{"name":"GIT_CONFIG_COUNT","slug":"git-config-count","description":"Stray git environment variables in your shell can no longer misdirect worktree operations."},{"name":"GIT_CONFIG_GLOBAL","slug":"git-config-global","description":"Git calls in the sync path now respect your custom global and system config paths."},{"name":"GIT_CONFIG_NOSYSTEM","slug":"git-config-nosystem","description":"Plugin eval helpers ignore machine-wide git settings so results cannot be skewed."},{"name":"GIT_CONFIG_SYSTEM","slug":"git-config-system","description":"Git calls in the sync path now respect your custom global and system config paths."},{"name":"GIT_INDEX_FILE","slug":"git-index-file","description":"Stray git environment variables in your shell can no longer misdirect worktree operations."},{"name":"GIT_PROXY_COMMAND","slug":"git-proxy-command","description":"Every git command Claude runs now has hooks, filesystem monitors and prompt helpers turned off."},{"name":"GIT_SSH_COMMAND","slug":"git-ssh-command","description":"Git runs with strict host-key checking and risky protocols disabled, no matter your environment."}],"url":"https:\/\/changelogs.core-directive.com\/reference\/env\/git-dir","family_url":"https:\/\/changelogs.core-directive.com\/reference\/env.json"}