{"version":"2.1.309","anchor":"bash-tool-git-probe-now-runs-with-a-sanitized-git-environmen","canonical_anchor":"git-commands-drop-forced-lc-allc","heading":"Git commands run with a cleaned-up environment","tier":"notice","area":"Git","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.309\/e\/bash-tool-git-probe-now-runs-with-a-sanitized-git-environmen","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.309","markdown":"### Git commands run with a cleaned-up environment\n\nClaude Code's internal git calls now use a shared, cleaned environment, and the old forced LC_ALL=C setting is replaced\n\n**What**\n\nClaude Code runs git in the background for things like checking whether a file is tracked. The environment it gives git (the settings passed to a program when it starts, called environment variables) has changed:\n\n- The `git ls-files` and `git check-ignore` helpers now pass a shared set of leading arguments and an explicit environment.\n\n- The `git ls-files` check used by the Bash tool now builds a cleaned environment that sets `GIT_LITERAL_PATHSPECS`, `GIT_TRACE2`, `GIT_TRACE2_PERF` and `GIT_TRACE2_EVENT`. If the git program it finds fails a safety check, the file is treated as untracked.\n\n- A fixed environment that sets `LC_ALL` and `LANGUAGE` to `C` (which keeps git's output in plain English) now exists, and a `git rev-parse` call uses a shared helper for it instead of setting `LC_ALL=C` inline.\n\n- Several other git calls, including config reads, the shortstat call and one general git invocation, no longer force `LC_ALL=C` on their own and use the shared environment helper instead.\n\n**Why**\n\nGit calls are less affected by settings in your own environment, such as tracing output or a different way of reading file patterns. Because the forced `LC_ALL=C` was dropped from some calls, git output there may follow your language settings.\n\n- Area: Git\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}