Skip to content

CLI Reference

Convention enforcement

caliper init --agent

Set up the Claude Code stop hook.

bash
npx caliper init --agent

caliper refresh

Regenerate deterministic checks from CLAUDE.md files (root and nested). Requires ANTHROPIC_API_KEY.

bash
npx caliper refresh                # Auto-accept all generated checks
npx caliper refresh --interactive  # Manually approve each check

Local code review

caliper check

Review local changes before committing — no GitHub PR needed.

bash
npx caliper check              # Review staged changes interactively
npx caliper check --fix        # Auto-apply suggested fixes to working tree
npx caliper check --hook       # Non-interactive, exit 1 on blocking findings
npx caliper check --branch     # Review all commits on this branch vs base
npx caliper check --resume     # Resume the last review without re-running AI
npx caliper check --severity blocking  # Only report blocking issues
npx caliper check --agent      # Stop hook mode (deterministic only, exit 2 on violations)
npx caliper check --verbose    # Show Claude API request/response details
FlagDescription
--fixAuto-apply suggested fixes to working tree files
--hookNon-interactive mode for git hooks (exit 1 on blockers)
--fullRun full pipeline (synthesis, lenses, consolidation)
--resumeResume the last review without re-running AI
--branchReview all commits on this branch vs base branch
--severity <level>Minimum severity to report (blocking, suggestion, nit)
--agentStop hook mode (deterministic only, exit 2 on violations)
--all-filesCheck all source files, not just recently changed (agent mode)
--verboseShow Claude API request/response details

PR review

caliper <pr-number>

Run a full review pipeline on a pull request.

npx caliper <pr-number> [flags]
FlagDescription
--resumeResume from the last saved phase
--skip-refreshSkip the staleness check on startup
--no-postRun the review but skip the posting phase
--post-onlyPost findings from a previous review without re-running
--sequentialUse sequential finding reviewer instead of navigator
--fastForce fast path (skip synthesis/lenses/consolidation/narrative)
--fullForce full pipeline even for small PRs
--ciNon-interactive mode for CI/CD (auto-approve and post findings)
--min-severity <level>Minimum severity to post in CI mode (blocking, suggestion, nit)
--max-cost <amount>Cost ceiling in USD — skip review if exceeded (CI mode)
--fail-on-blockingExit 1 if blocking findings found (CI mode)
--verboseShow Claude API request/response details
--help, -hShow help message
--version, -vShow version number

Examples:

bash
npx caliper 142                # Full review
npx caliper 142 --resume       # Resume interrupted review
npx caliper 142 --no-post      # Review without posting
npx caliper 142 --post-only    # Re-enter approval for existing findings
npx caliper 142 --fast         # Force fast path
npx caliper 142 --ci           # Non-interactive CI mode

Utilities

caliper init

Scaffold .caliper/ configuration in your repo.

bash
npx caliper init            # Interactive setup
npx caliper init --yes      # Non-interactive (use detected defaults)
npx caliper init --agent    # Set up Claude Code stop hook

caliper trace

View the pipeline trace for a completed review.

bash
npx caliper trace <pr-number>          # Print summary and open trace.html
npx caliper trace <pr-number> --json   # Print path to trace.json

Output includes: step count, AI call count, total duration, cost estimate, and convention check results.

caliper clean

Remove old review state and trace files.

bash
npx caliper clean                  # Remove all review state
npx caliper clean <pr-number>      # Remove state for a specific PR
npx caliper clean --older-than 7   # Remove reviews older than 7 days

caliper-post

Standalone script for posting findings from a completed review.

bash
# Post specific findings by index
npx caliper-post <pr-number> <index> [<index> ...]

# Post all pending findings as a batched review
npx caliper-post <pr-number> --review [--event REQUEST_CHANGES|COMMENT|APPROVE]

Released under the MIT License.