Code Review
AI code review that enforces your rules on every pull request and inside every coding agent session. Catches bugs, security issues, and convention violations before they ship.
Your agent reviews its own code after every turn.
sag init sets this up automatically. The background reviewer looks at every change like a staff engineer — catching 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:
Codify your standards in markdown.
Rules are markdown files in .saguaro/rules/. Saguaro matches them to changed files via globs and feeds them to the AI reviewer alongside your diff.
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.
Works with every major coding agent.
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 and blocks on violations.
Manual Review
Run sag review on-demand to check your changes against all rules. JSON output available for CI.
Other Agents
sag review — run manually or in CIsag review — same CLI, same rulessag review --output json — deeplinks to violationssag review --output json — exit code 1 on errorsBackground Daemon
For long sessions, sag daemon start reviews changes in parallel on localhost:7474 — findings surface as soft guidance, no blocking.
Code review on every pull request.
The inner-loop CLI catches issues while your agent is coding. The outer-loop review agent runs on every pull request in your GitHub repository — reviewing changes against your rules, org conventions, and the full context of your codebase. It comments directly on your PRs like a senior engineer on your team.
Same Rules
Uses your .saguaro/rules/ directory. Write once, enforce everywhere — locally and on PRs.
Full Context
The review agent understands your codebase structure, not just the diff. It catches issues that span multiple files.
GitHub Native
Installs as a GitHub App. Comments inline on PRs with file and line references. No configuration beyond connecting your repo.
Install in under a minute.
$ npm install -g @mesadev/saguaro && sag init