Configuration

Full reference for .saguaro/config.yaml and environment setup.

1. CONFIG FILE

Saguaro reads its configuration from .saguaro/config.yaml in your project root. Run sag init to generate a starter config, or create one by hand.

.saguaro/config.yaml
1# AI model for reviews
2model:
3 provider: anthropic # anthropic | openai | google
4 name: sonnet # CLI alias (e.g. "sonnet", "opus") or model ID
5
6# Output settings
7output:
8 cursor_deeplink: true # Print Cursor IDE links for violations
9
10# Review tuning
11review:
12 max_steps: 10 # Max tool-calling steps per review batch
13 files_per_batch: 2 # Files reviewed together per batch
14
15# Hook settings
16hook:
17 enabled: true # Master switch for all Saguaro hooks
18 stop:
19 enabled: true # Rules review after each code change
20
21# Background daemon (classic reviews)
22# daemon:
23# enabled: true

2. MODEL PROVIDER

2.1Anthropic (default) — set ANTHROPIC_API_KEY. Models: claude-opus-4-6, claude-sonnet-4-5-20250514, etc.

2.2OpenAI — set OPENAI_API_KEY. Models: gpt-4o, gpt-4o-mini, o3, etc.

2.3Google — set GOOGLE_API_KEY. Models: gemini-2.5-pro, gemini-2.5-flash, etc.

3. API KEY MANAGEMENT

API keys are loaded in order: environment variables, then .env.local, then .env.

sag init can store your key in .env.local during setup.

Recommend adding .env.local to your .gitignore to avoid committing secrets.

1# Option 1: Environment variable
2export ANTHROPIC_API_KEY=sk-ant-...
3
4# Option 2: .env.local file (created by sag init)
5ANTHROPIC_API_KEY=sk-ant-...

4. REVIEW TUNING

max_steps (default: 10) — max AI tool-calling steps per review batch. Higher values produce more thorough reviews but are slower and costlier.

files_per_batch (default: 2) — files grouped per review batch. Lower values produce more focused reviews.

5. INDEX CONFIGURATION

enabled (default: true) — enable import graph indexing for richer cross-file context during reviews.

blast_radius_depth (default: 1) — BFS depth for dependency traversal. Higher values pull in more transitive dependents.

context_token_budget (default: 4000) — max tokens of surrounding context included per review.

Run sag index to build the import graph initially. Saguaro uses it automatically during subsequent reviews.

6. DAEMON CONFIGURATION

The background daemon runs classic (senior-engineer-style) reviews asynchronously. Findings are advisory and surfaced on the next agent turn — independent of the rules review system. Configure it under the daemon key.

enabled (default: false) — enable the background daemon.

workers (default: 1) — number of concurrent review workers (max 2).

idle_timeout (default: 1800) — seconds before auto-shutdown when idle.

.saguaro/config.yaml
1daemon:
2 enabled: true

7. PRE-PUSH HOOK

Add a git hook to automatically run reviews before pushing. This ensures all changes are reviewed before they reach the remote.

.git/hooks/pre-push
1#!/bin/bash
2sag review --base origin/main