Back to browse
GitHub Repository

Local AI code review for coding agents. Rules enforced inside Claude Code, Codex, and Cursor. Free, open-source, fully local.

11 starsTypeScript

Saguaro: CLI that makes Claude Code fix its own mistakes

by Mitchem·Mar 11, 2026·3 points·3 comments

AI Analysis

●●SolidShip ItSolve My Problem

Stop hook feeds code review back to Claude while context is still hot.

Strengths
  • Tree-sitter and SWC import graph shows blast radius for smarter context gathering
  • PreToolUse and Stop hooks integrate directly into Claude Code's workflow
  • Token-budgeted reviews keep feedback fast without bloating agent context windows
Weaknesses
  • AI code review is crowded with Cursor, CodeRabbit, and GitHub Copilot already
  • Requires agent CLI subscription; fallback API keys add cost for heavy users
Target Audience

Developers using Claude Code, Codex, or Cursor

Similar To

CodeRabbit · Cursor · Reviewable

Post Description

I've been using Claude Code Max and Codex daily and kept hitting the same problem; AI quickly ships working code that have real issues: logic errors, security gaps, subtle regressions. You catch them in review, fix them, but the agent session has already closed. Doesn't it make sense to have the AI fix its own mistakes while it still knows why it made them?

Saguaro is a background daemon that reviews AI-generated code and feeds findings back to the same agent that wrote it. The agent evaluates the critique, it knows why it made those decisions in the first place, and self-corrects what's actually wrong.

The flow: you tell Claude Code to build something. Claude writes code. Saguaro's stop hook triggers a background review (the user sees nothing). On the next turn, findings come back to Claude. Claude says "I see some issues with my approach, fixing now" and corrects itself. No human typed anything. No blocking.

It uses your existing Claude Code / Codex / Gemini subscription. No API key needed. No external account. Everything runs locally. The daemon self-spawns on demand and auto-shuts down after 30 minutes of inactivity.

There's also a rules engine for teams that want more deterministic enforcement. You write rules as markdown files with YAML frontmatter, scoped to specific file globs. But the daemon works out of the box with zero rules. It reviews like a senior staff engineer: bugs, security, regressions, dead code. The rules engine adds more precision for teams/individuals that need it.

Setup is "sag init" + restart CC + go back to coding. That's it.

Apache-2.0. TypeScript.

Similar Projects