Claude Commit Guard
Claude Commit Guard is a Visual Studio Code extension that runs a Claude Code review on your staged Git changes before you commit.
It is designed for developers who want a practical, senior-level review of their staged diff directly inside VS Code, without using an Anthropic API key or buying separate API credits. The extension uses the local Claude Code CLI, so it works through your existing Claude Code authentication.
Features
Claude Commit Guard reviews your staged Git diff and produces a structured Markdown report.
The review includes:
- Commit verdict:
SAFE_TO_COMMIT, COMMIT_WITH_CAUTION, or DO_NOT_COMMIT
- Executive summary
- Changed areas detected
- Blocking issues
- Recommended improvements
- Security and privacy notes
- Backward compatibility notes
- Edge cases to verify
- Tests to add
- Manual QA checklist
- Suggested commit message
- Confidence level
- English review followed by Hebrew review
- Visual separators between sections for easier reading
Source Control Panel
Claude Commit Guard adds a dedicated panel inside the VS Code Source Control view.
From the panel you can:
- Run a review manually
- Enable or disable automatic review
- Open extension settings
- See current timeout, debounce, cooldown, max diff size, Claude CLI path, and last status
Manual Review Flow
The recommended manual flow is:
git add .
Then run:
Claude Commit Guard: Review Staged Changes
The extension will read:
git diff --cached --no-ext-diff
Then it will send the staged diff to Claude Code CLI and open the review as a Markdown document inside VS Code.
Automatic Review
Claude Commit Guard can automatically run a review after you stage changes.
Automatic review is disabled by default.
When enabled, the extension watches the Git index file and starts a review after staged changes are detected.
The automatic review includes safety controls:
- Debounce delay after staging
- Cooldown between automatic reviews
- Diff hash check to avoid reviewing the same diff repeatedly
- Maximum staged diff size limit
- Automatic skip when possible secrets are detected
- Manual review remains available for large or sensitive diffs
Requirements
Claude Commit Guard requires:
- Visual Studio Code
- Git
- Claude Code CLI installed locally
- Claude Code authenticated on your machine
The extension does not require an Anthropic API key.
Installing Claude Code CLI
On Windows PowerShell, Claude Code can be installed with:
irm https://claude.ai/install.ps1 | iex
After installation, verify that Claude Code is available:
claude --version
If claude is not recognized, make sure the Claude Code installation directory is included in your system PATH.
On some Windows installations, Claude Code may be installed under:
C:\Users\<YOUR_USER>\.local\bin\claude.exe
If needed, configure the full path in VS Code settings:
"claudeCommitGuard.claudeExecutablePath": "C:\\Users\\<YOUR_USER>\\.local\\bin\\claude.exe"
Extension Settings
Claude Commit Guard contributes the following settings:
{
"claudeCommitGuard.claudeExecutablePath": "claude",
"claudeCommitGuard.claudeModel": "",
"claudeCommitGuard.reviewTimeoutMs": 300000,
"claudeCommitGuard.maxTurns": 1,
"claudeCommitGuard.autoReviewOnStage": false,
"claudeCommitGuard.autoReviewDebounceMs": 3000,
"claudeCommitGuard.autoReviewCooldownMs": 30000,
"claudeCommitGuard.autoReviewMaxDiffChars": 80000
}
claudeCommitGuard.claudeExecutablePath
Path to the Claude Code CLI executable.
Default:
"claude"
Use this when Claude Code is available through your PATH.
For a custom Windows path:
"C:\\Users\\<YOUR_USER>\\.local\\bin\\claude.exe"
claudeCommitGuard.claudeModel
Optional Claude Code model alias or full model name.
Leave empty to use the Claude Code default.
claudeCommitGuard.reviewTimeoutMs
Maximum time to wait for Claude Code review.
Default:
300000
That equals five minutes.
claudeCommitGuard.maxTurns
Maximum number of Claude Code turns for the review.
Default:
1
claudeCommitGuard.autoReviewOnStage
Enable or disable automatic review after staging changes.
Default:
false
claudeCommitGuard.autoReviewDebounceMs
Delay after a staging event before automatic review starts.
Default:
3000
claudeCommitGuard.autoReviewCooldownMs
Minimum time between automatic reviews.
Default:
30000
claudeCommitGuard.autoReviewMaxDiffChars
Maximum staged diff size for automatic review.
Default:
80000
Manual review still works for larger diffs.
Privacy and Security
Claude Commit Guard sends your staged Git diff to the local Claude Code CLI.
Before sending the diff, the extension scans for common secret patterns such as:
password
apiKey
secret
- private keys
- connection strings
If possible secrets are detected:
- Manual review asks for confirmation before continuing.
- Automatic review is skipped.
This detection is best-effort only. You are responsible for reviewing what you stage before sending it to Claude Code.
The extension does not store your code, does not store reviews, and does not use an Anthropic API key.
Known Limitations
Claude Commit Guard is a diff-based reviewer.
It reviews only the staged changes and may not fully understand:
- Runtime behavior outside the diff
- External service contracts
- Database schema assumptions
- Build-time generated files
- Hidden dependencies
- Files excluded from the staged diff
For critical changes, use Claude Commit Guard as an additional review layer, not as a replacement for human review, tests, CI, or security checks.
Recommended Workflow
For regular work:
git add .
Run:
Claude Commit Guard: Review Staged Changes
Review the generated Markdown report.
Fix issues if needed.
Then commit:
git commit -m "your commit message"
For automatic review, enable:
"claudeCommitGuard.autoReviewOnStage": true
Development
Install dependencies:
npm install
Compile:
npm run compile
Run the extension in development mode:
F5
Package locally:
npm run package
This creates a .vsix file that can be installed manually in VS Code.
Release Notes
1.0.1
Initial release.
- Manual review of staged Git changes
- Claude Code CLI integration
- Source Control panel
- Optional automatic review after staging
- Bilingual English/Hebrew review output
- Visual separators between review sections
- Secret detection safety check
- Markdown review output