Complete reference for all Saguaro CLI commands.
| Command | Description |
|---|---|
sag init | Set up Saguaro in your repo |
sag review | Review code changes against your rules |
sag rules generate | Auto-generate rules by analyzing your codebase |
sag rules create [dir] | Create a new rule with AI assistance |
sag rules list | List all rules with IDs, titles, and severity |
sag rules explain <id> | Show full details for a rule |
sag rules validate | Check all rule files for correct structure |
sag rules delete <id> | Delete a rule |
sag rules locate | Print the path to the rules directory |
sag index | Build the import graph for richer review context |
sag hook install | Enable automatic reviews in Claude Code |
sag hook uninstall | Disable automatic reviews |
sag daemon start | Start the background review daemon |
sag daemon stop | Stop the background review daemon |
sag daemon status | Check if the daemon is running |
sag model | Switch AI provider and model interactively |
sag stats | Show review history and cost analytics |
Review code changes. Diffs the current branch against a base branch and runs the selected review mode.
rules (default) — checks changed files against your rules in .saguaro/rules/. Maximum signal, lowest noise.
classic — permissive senior-engineer-style review looking for bugs, security issues, and regressions. No rules needed.
full — runs both rules and classic reviews together.
1-m, --mode Review mode: rules, classic, or full [default: "rules"]2-b, --base Base branch to diff against [default: "main"]3 --head Head ref to review [default: "HEAD"]4-o, --output Output format: console, json [default: "console"]5-v, --verbose Show detailed progress [default: false]6 --debug Write debug logs to .saguaro/.tmp/ [default: false]7-c, --config Path to config file [default: ".saguaro/config.yaml"]8 --rules Path to rules directory [default: ".saguaro/rules/"]Create a new rule with AI assistance. Optionally target a specific directory and provide an intent for what the rule should enforce.
1sag rules create [target]2
3 target Directory the rule targets (e.g. src/api)4 --intent What the rule should enforce5 --severity error, warning, or info6 --title Rule title (auto-generated if omitted)7 --skip-preview Skip the file-match preview stepWalks through setup — creates .saguaro/config.yaml and the .saguaro/rules/ directory, offers rule generation options (starter rules, generate from codebase, or start empty), and sets up Claude Code integration.
Builds the import graph for your codebase. Supports TS/JS (SWC), Python, Go, Rust, Java, and Kotlin (tree-sitter). Run once, then Saguaro uses it automatically during reviews.
install — Adds PreToolUse and StopHook to Claude Code's hook configuration.
uninstall — Removes the hooks.
Both commands modify .claude/settings.json.
start — Starts the background review daemon on localhost. Reviews changes asynchronously while the agent continues working.
stop — Stops the running daemon.
Enable in .saguaro/config.yaml under the daemon key.
Shows review history and cost analytics from .saguaro/history/reviews.jsonl.