Skip to content

Local Code Review

caliper check reviews your local changes with AI before you commit — no GitHub PR needed. It analyzes staged changes for logic errors, security issues, design problems, and convention violations, then presents findings interactively.

Basic usage

bash
npx caliper check

This reviews staged changes and presents findings interactively. Requires ANTHROPIC_API_KEY.

--fix mode

bash
npx caliper check --fix

Auto-applies suggested fixes directly to your working tree files. Each fix is applied in place — review the changes with git diff before committing.

--hook mode

bash
npx caliper check --hook

Non-interactive mode designed for git pre-commit hooks. Exits with code 1 if blocking findings are found, code 0 otherwise. No interactive prompts.

To install as a git pre-commit hook, add to .git/hooks/pre-commit:

bash
#!/bin/sh
npx caliper check --hook

Variants

FlagDescription
--branchReview all commits on this branch vs base branch
--fullRun full pipeline (synthesis, lenses, consolidation)
--resumeResume the last review without re-running AI

Severity filter

bash
npx caliper check --severity blocking   # only report blocking issues

Interpreting results

Severity levels

LevelMeaning
blockingMust be fixed before merging. Security issues, logic bugs, broken contracts.
suggestionShould be addressed but not a merge blocker. Design improvements, readability, error handling gaps.
nitMinor style or preference issue. Naming, import order, formatting.

Categories

Listed in priority order (within each severity level):

CategoryWhat it covers
securityAuth guards, injection vulnerabilities, credential exposure, input validation
logicOff-by-one errors, race conditions, null/undefined handling, edge cases
error-handlingRecovery logic, error propagation, swallowed errors, actionable messages
designSingle responsibility, abstraction level, naming, coupling, duplication
performanceN+1 queries, missing pagination, unbounded operations
boy-scoutDead code, stale comments, unnecessary complexity in modified code
testabilityMissing tests for behavior changes, untestable structure
conventionProject-specific conventions from deterministic checks

Confidence levels

LevelMeaning
highStrong evidence in the code. The finding is almost certainly correct.
mediumLikely correct based on the diff, but may need human judgment.
lowPossible issue flagged for review. Evidence and reasoning are shown in the Details tab for you to evaluate.

Every AI finding includes evidence (specific file paths, line numbers, or code patterns) and an explanation (the AI's reasoning). These are for your eyes only — they are not posted to the PR.

Released under the MIT License.