Check AI-Generated Code With Git Hooks
AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs β without telling you. You often find out in production.
git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.
- π€ AI agents silently break things. Code removed. Logic changed. Edge cases gone. You won't notice until production.
- π Catch it before it ships. AI-powered inline comments show you exactly what changed and what looks wrong.
- π Build a habit, ship better code. Regular review β fewer bugs β more robust code β better results in your team.
- π Why git? Git is universal. Every editor, every IDE, every AI toolkit uses it. Committing is mandatory. So there's almost no chance of missing a review β regardless of your stack.
Linux / macOS:
curl -fsSL https://hexmos.com/lrc-install.sh | sudo bashWindows (PowerShell):
iwr -useb https://hexmos.com/lrc-install.ps1 | iexBinary installed. Hooks set up globally. Done.
git lrc setupTwo steps, both open in your browser:
- LiveReview API key β sign in with Hexmos
- Free Gemini API key β grab one from Google AI Studio
~1 minute. One-time setup, machine-wide. After this, every git repo on your machine triggers review on commit. No per-repo config needed.
git add .
git commit -m "add payment validation"
# review launches automatically before the commit goes throughgit add .
git lrc review # run AI review first
# or: git lrc review --vouch # vouch personally, skip AI
# or: git lrc review --skip # skip review entirely
git commit -m "add payment validation"Either way, a web UI opens in your browser.
π GIF: git add + git commit triggering review, browser opening
- π GitHub-style diff β color-coded additions/deletions
- π¬ Inline AI comments β at the exact lines that matter, with severity badges
- π Review summary β high-level overview of what the AI found
- π File sidebar β jump between files, see comment counts
π GIF: Web UI with diff view, inline comments, file sidebar, summary
| Action | What happens |
|---|---|
| β Commit | Accept and commit the reviewed changes |
| π Commit & Push | Commit and push to remote in one step |
| βοΈ Skip | Abort the commit β go fix issues first |
π Screenshot: Pre-commit bar showing Commit / Commit & Push / Skip buttons
Typical workflow with AI-generated code:
- Generate code with your AI agent
git add .βgit lrc reviewβ AI flags issues- Copy issues, feed them back to your agent to fix
git add .βgit lrc reviewβ AI reviews again- Repeat until satisfied
git lrc review --vouchβgit commitβ you vouch and commit
Each git lrc review is an iteration. The tool tracks how many iterations you did and what percentage of the diff was AI-reviewed (coverage).
Once you've iterated enough and you're satisfied with the code:
git lrc review --vouchThis says: "I've reviewed this β through AI iterations or personally β and I take responsibility." No AI review runs, but coverage stats from prior iterations are recorded.
Just want to commit without review or responsibility attestation?
git lrc review --skipNo AI review. No personal attestation. The git log will record skipped.
Every commit gets a review status line appended to its git log message:
LiveReview Pre-Commit Check: ran (iter:3, coverage:85%)
LiveReview Pre-Commit Check: vouched (iter:2, coverage:50%)
LiveReview Pre-Commit Check: skipped
iterβ number of review cycles before committing.iter:3= three rounds of review β fix β review.coverageβ percentage of the final diff already AI-reviewed in prior iterations.coverage:85%= only 15% of the code is unreviewed.
Your team sees exactly which commits were reviewed, vouched, or skipped β right in git log.
| Review | Vouch | Skip | |
|---|---|---|---|
| AI reviews the diff? | β Yes | β No | β No |
| Takes responsibility? | β Yes | β Yes, explicitly | |
| Tracks iterations? | β Yes | β Records prior coverage | β No |
| Git log message | ran (iter:N, coverage:X%) |
vouched (iter:N, coverage:X%) |
skipped |
| When to use | Each review cycle | Done iterating, ready to commit | Not reviewing this commit |
Review is the default. AI analyzes your staged diff and gives inline feedback. Each review is one iteration in the changeβreview cycle.
Vouch means you're explicitly taking responsibility for this commit. Typically used after multiple review iterations β you've gone back and forth, fixed issues, and are now satisfied. The AI doesn't run again, but your prior iteration and coverage stats are recorded.
Skip means you're not reviewing this particular commit. Maybe it's trivial, maybe it's not critical β the reason is yours. The git log simply records skipped.
git-lrc uses Google's Gemini API for AI reviews. Gemini offers a generous free tier. You bring your own API key β there's no middleman billing. The LiveReview cloud service that coordinates reviews is free for individual developers.
Only the staged diff is analyzed. No full repository context is uploaded, and diffs are not stored after review.
lrc hooks disable # disable for current repo
lrc hooks enable # re-enable laterlrc review --commit HEAD # review the last commit
lrc review --commit HEAD~3..HEAD # review a range| Command | Description |
|---|---|
lrc or lrc review |
Review staged changes |
lrc review --vouch |
Vouch β skip AI, take personal responsibility |
lrc review --skip |
Skip review for this commit |
lrc review --commit HEAD |
Review an already-committed change |
lrc hooks disable |
Disable hooks for current repo |
lrc hooks enable |
Re-enable hooks for current repo |
lrc hooks status |
Show hook status |
lrc self-update |
Update to latest version |
lrc version |
Show version info |
Tip:
git lrc <command>andlrc <command>are interchangeable.
git-lrc is completely free. No credit card. No trial. No catch.
If it helps you β share it with your developer friends. The more people review AI-generated code, the fewer bugs make it to production.
β Star this repo to help others discover it.
git-lrc is distributed under a modified variant of Sustainable Use License (SUL).
Note
What this means:
- β Source Available β Full source code is available for self-hosting
- β Business Use Allowed β Use LiveReview for your internal business operations
- β Modifications Allowed β Customize for your own use
- β No Resale β Cannot be resold or offered as a competing service
- β No Redistribution β Cannot redistribute modified versions commercially
This license ensures LiveReview remains sustainable while giving you full access to self-host and customize for your needs.
For detailed terms, examples of permitted and prohibited uses, and definitions, see the full LICENSE.md.
Using
git-lrcsolo? Great. Building with a team? Check out LiveReview β the full suite for team-wide AI code review, with dashboards, org-level policies, and review analytics. Everythinggit-lrcdoes, plus team coordination.