Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/getsentry/warden/llms.txt

Use this file to discover all available pages before exploring further.

warden

The main Warden command runs code analysis on your repository using AI-powered skills. It can analyze specific files, git changes, or use triggers configured in warden.toml.

Usage

warden [targets...] [options]

Targets

Warden accepts multiple target types to specify what code to analyze:
files
string
Specific file paths to analyze
warden src/auth.ts
warden src/auth.ts src/utils.ts
globs
string
Glob patterns to match multiple files (must be quoted)
warden "src/**/*.ts"
warden "src/**/*.{ts,tsx}"
git-ref
string
Git references to analyze changes since a commit or between refs
warden HEAD~3           # Changes in last 3 commits
warden main..feature    # Changes between branches
warden HEAD~1..HEAD     # Most recent commit
(none)
-
When no targets are provided, Warden uses triggers from warden.toml to analyze uncommitted changes
warden  # Analyze uncommitted changes
For ambiguous targets (no path separator, no extension), Warden checks if a file exists at that path before treating it as a git ref. Use --git to force git ref interpretation.

Options

Skill Selection

--skill
string
Run only the specified skill instead of all configured skills
warden --skill security-review
warden src/auth.ts --skill bug-detection

Configuration

--config
string
default:"./warden.toml"
Path to the Warden configuration file
warden --config .warden/custom.toml
-m, --model
string
Model to use for analysis (fallback when not set in config)
warden --model claude-sonnet-4.5
warden -m claude-opus-4

Output Control

--json
boolean
default:"false"
Output results in JSON format instead of human-readable format
warden --json
warden --json > results.json
-o, --output
string
Write full run output to a JSONL file for later replay
warden -o run.jsonl
warden --output .warden/logs/$(date +%s).jsonl

Filtering

--fail-on
string
Exit with code 1 if findings are at or above the specified severity levelValues: off, critical, high, medium, low, info
warden --fail-on high      # Fail on high or critical
warden --fail-on medium    # Fail on medium, high, or critical
--report-on
string
Only show findings at or above the specified severity in outputValues: off, critical, high, medium, low, info
warden --report-on high    # Only show high and critical
--min-confidence
string
default:"medium"
Only show findings at or above the specified confidence levelValues: off, high, medium, low
warden --min-confidence high  # Only high confidence findings

Execution Control

--fix
boolean
default:"false"
Automatically apply all suggested fixes without prompting
warden --fix
--parallel
number
default:"4"
Maximum number of concurrent trigger/skill executions
warden --parallel 8
warden --parallel 1  # Sequential execution
-x, --fail-fast
boolean
default:"false"
Stop execution after the first finding is detected
warden --fail-fast
warden -x

Git Integration

--staged
boolean
default:"false"
Analyze only staged changes (git diff —cached)
warden --staged
--git
boolean
default:"false"
Force ambiguous targets to be interpreted as git refs instead of files
warden --git main  # Treat 'main' as branch, not file
--offline
boolean
default:"false"
Use cached remote skills without attempting network access
warden --offline

Verbosity

--quiet
boolean
default:"false"
Show errors and final summary only
warden --quiet
-v, --verbose
flag
Show real-time findings and analysis details. Use -vv for debug information including token counts and latencies
warden -v      # Verbose output
warden -vv     # Debug output
--debug
boolean
default:"false"
Enable debug output (equivalent to -vv)
warden --debug
--log
boolean
default:"false"
Use log output mode (no animations, timestamped lines)
warden --log
--color / --no-color
boolean
Force color output on or off (overrides auto-detection)
warden --color     # Force color
warden --no-color  # Disable color

Help

--help, -h
boolean
Show help message with all commands and options
warden --help
warden -h
--version, -V
boolean
Show version number
warden --version
warden -V

Exit Codes

0
Success
Analysis completed successfully with no failures
1
Error
  • Configuration error
  • Invalid arguments
  • Skill execution error
  • Findings met --fail-on threshold
130
Interrupted
User interrupted execution with Ctrl+C

Examples

Analyze Specific Files

# Single file
warden src/auth.ts

# Multiple files
warden src/auth.ts src/api/endpoints.ts

# With specific skill
warden src/auth.ts --skill security-review

Analyze with Glob Patterns

# All TypeScript files in src/
warden "src/**/*.ts"

# TypeScript and TSX files
warden "src/**/*.{ts,tsx}"

# Exclude tests
warden "src/**/*.ts" "!**/*.test.ts"

Analyze Git Changes

# Changes in last 3 commits
warden HEAD~3

# Changes between branches
warden main..feature

# Only staged changes
warden --staged

# Uncommitted changes
warden

Control Output

# JSON output
warden --json

# Save to JSONL file
warden -o results.jsonl

# Quiet mode (summary only)
warden --quiet

# Verbose with debug info
warden -vv

Fail on Severity

# Fail CI if high or critical findings
warden --fail-on high

# Show only critical findings
warden --report-on critical

# High confidence findings only
warden --min-confidence high

Automatic Fixes

# Apply all fixes automatically
warden --fix

# Interactive fix mode (default when fixes available)
warden

Remote Skills

# Use cached skills only (no network)
warden --offline

# Specify model
warden --model claude-sonnet-4.5

Environment Variables

WARDEN_ANTHROPIC_API_KEY
string
required
Anthropic API key for Claude model access. Can be set in .env.local
WARDEN_MODEL
string
Default model to use when not specified in config or CLI
WARDEN_SENTRY_DSN
string
Sentry DSN for error tracking (optional)

Notes

  • Warden loads environment variables from .env and .env.local in the repository root
  • When no targets are specified, Warden uses triggers defined in warden.toml
  • Skills are discovered from .agents/skills/ and .claude/skills/ directories
  • Logs are automatically saved to .warden/logs/ when a run completes
  • Use warden logs to view saved runs