Follow Discord
Sweep 10 Nov 2026 · 02:18Z Build v2.1.322 539 read Stable v2.1.311 Latest v2.1.322 Next v2.1.322 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.1.321 ·

Environment variable to limit the built-in git check to git repositories

Setting CLAUDE_CODE_GIT_CHECK_ONLY_IN_REPOSITORY lets Claude Code skip its built-in git check when you are not inside a git repository

Use it now Notable No documentation found New Features
JSON All of v2.1.321
Use it nowTier: how much it should matter to you
5Useful: my rating, 1 to 5
3Signal: worth watching, 1 to 5
HooksArea: what it touches
New FeaturesKind: in v2.1.321,
What probably matters to youSection of the release

Unclear It is not confirmed that setting the variable actually stops the hook from running.

What

A Stop hook is a script that runs when Claude finishes responding. Claude Code ships a default one, ~/.claude/stop-hook-git-check.sh, which checks the state of git. A new environment variable, CLAUDE_CODE_GIT_CHECK_ONLY_IN_REPOSITORY, lets Claude Code skip that hook outside a git repository. An environment variable is a named value set in your shell before you start Claude Code. Claude Code reads it once and then removes it, so programs it starts do not see it. To decide whether you are in a repository, Claude Code looks for .git or HEAD in the current folder or any folder above it.

The hook is skipped only if it is the unchanged default command. It is never skipped in these cases:

Why

Running a git check in a folder that is not a git repository does nothing useful. This lets you stop it there. Anything you have customised, or any setup that changes how git or the shell behaves, still runs the hook.

Read from
How sure we are
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubtIt is not confirmed that setting the variable actually stops the hook from running.
The name it cites is new in this buildNew in this build: CLAUDE_CODE_GIT_CHECK_ONLY_IN_REPOSITORY

See this entry in the whole of v2.1.321 →

Feedback