PUBLICATION MESA-2026-003
REV. A — MARCH 2026
Saguaro
Open source AI code review for coding agents. Rules enforced inside Claude Code, Codex, Gemini CLI, and Cursor. Your agent fixes its own mistakes while context is hot.
$ npm install -g @mesadev/saguaro && sag initsag init sets this up automatically. The background reviewer looks at every change like a staff engineer. It catches bugs, security issues, and regressions without any configuration. The agent fixes findings while context is still hot.
For deterministic enforcement, Saguaro also supports rules: markdown files matched to changed files via globs:
Rules are markdown files in .saguaro/rules/. Saguaro matches them to changed files via globs.
1---2id: no-raw-sql3title: Use parameterized queries for all database calls4severity: error5globs:6 - "src/api/**/*.ts"7 - "src/db/**/*.ts"8---9
10Do not use string interpolation or concatenation to build SQL queries.11Use parameterized queries or the ORM's query builder.12
13### Violations14
15```typescript16const user = await db.query(`SELECT * FROM users WHERE id = ${id}`)17```18
19### Compliant20
21```typescript22const user = await db.query('SELECT * FROM users WHERE id = ?', [id])23```sag init generates rules from your codebase automatically, or write them by hand. sag rules generate adds more at any time.
sag init wires everything automatically. Here's what it creates:
Claude Code
1{2 "hooks": {3 "PreToolUse": [{4 "matcher": "Edit|Write",5 "hooks": [{6 "type": "command",7 "command": "sag hook pre-tool",8 "timeout": 109 }]10 }],11 "Stop": [{12 "hooks": [{13 "type": "command",14 "command": "sag hook run",15 "timeout": 12016 }]17 }]18 }19}PreToolUse injects relevant rules before the agent writes code. Stop reviews changes after each turn — blocks on violations.
Manual Review
Run sag review on-demand to check your changes against all rules. JSON output available for CI.
Other Agents
| Codex CLI | sag review — run manually or in CI |
| Gemini CLI | sag review — same CLI, same rules |
| Cursor | sag review --output json — deeplinks to violations |
| CI | sag review --output json — exit code 1 on errors |
Background Daemon
For long sessions, sag daemon start reviews changes in parallel on localhost:7474 — findings surface as soft guidance, no blocking.
| Execution | Fully local. Your code never leaves your machine. |
| AI Providers | Anthropic, OpenAI, Google — uses your agent CLI subscription, no API key needed |
| Agents | Claude Code, Codex CLI, Gemini CLI, Cursor |
| Review Modes | On-demand CLI, automatic stop hook, background daemon |
| Output | Console with file:line locations, JSON for CI, Cursor deeplinks |
| Rule Format | Markdown with YAML frontmatter, glob-based file matching |
| License | Apache-2.0 — fully open source |
| Package | @mesadev/saguaro |
| Source | github.com/mesa-dot-dev/saguaro |