Claude Code v2.1.332 ·
Git reads now run in a locked-down environment
Claude Code now reads from git in a restricted environment and refuses when git could be pointed at another folder
Under the hoodTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
GitArea: what it touches
Internal ChangesKind: in v2.1.332,
Internal ChangesSection of the release
What
Claude Code now prepares a restricted environment for the git commands it uses to read repositories:
GIT_QUARANTINE_PATH is set
GIT_OPTIONAL_LOCKS=0 is set, so reading does not take optional locks on the repository
core.alternateRefsCommand is emptied, so it cannot run a program
- alternates, git's way of borrowing objects from other repositories, are checked, along with the repository's layout
If git could be made to use another folder as the repository, Claude Code refuses with a message saying so.
Why
This protects you against repositories set up to make git do something harmful when Claude Code reads from them.
See this entry in the whole of v2.1.332 →