Skip to content

Configuration

All Caliper configuration lives in .caliper/ at your repo root.

FilePurposeHow it's created
config.yamlProject configurationcaliper init (regenerated each run)
policy.mdReview policy the AI evaluates againstcaliper init (you can customize)
checks.jsGenerated deterministic checkscaliper refresh (auto-generated)
conventions.yamlGenerated judgment-based conventionscaliper refresh (auto-generated)

config.yaml reference

Project structure

FieldTypeDefaultDescription
presetstringauto-detectedFramework preset: typescript, python, go, ruby, rust, java
srcDirsstring[]["src"]Directories containing source code
excludeDirsstring[]["node_modules"]Directories to exclude from scanning
fileIncludesstring[]all supportedGlob patterns for source files

File classification

FieldTypeDefaultDescription
excludeFilesstring[]["\\.lock$", "\\.snap$"]Regex patterns for files to exclude from review
fileTypePatternsmap{}Regex patterns mapping file paths to type labels (e.g., api-route, component, test)
riskPatternsobjectsee belowRegex patterns for classifying files as high/medium/low risk

Default risk patterns:

  • high: auth/, migrations?/, schema.prisma, /api/
  • medium: /lib/, config\.[^/]+$
  • low: .test., .spec., .md, .css, .json, docs/

Example:

yaml
fileTypePatterns:
  api-route: "^(?:app|src)/api/.+/route\\.[jt]sx?$"
  component: "^(?:app|src)/.+\\.(tsx|jsx)$"
  test: "\\.(?:test|spec)\\.[jt]sx?$"

riskPatterns:
  high:
    - pattern: "auth/"
      reason: auth/security file
    - pattern: "migrations?/"
      reason: schema/migration change
  medium:
    - pattern: "/lib/"
      reason: library code
  low:
    - pattern: "\\.test\\.[^/]+$"
      reason: test file

Validation patterns

FieldTypeDefaultDescription
prTitlePatternstring (regex)noneRegex for validating PR titles (e.g., conventional commits)
branchPatternstring (regex)noneRegex for validating branch names

Example:

yaml
prTitlePattern: "^(feat|fix|chore|docs|refactor|test|ci|build|perf|style)(\\(.+\\))?!?: .+"
branchPattern: "^(feat|fix|chore|docs|refactor|test|ci|build|perf|style)/.+"

Toolchain

FieldTypeDefaultDescription
toolchain.formatstringnoneFormat check command
toolchain.lintstringnoneLint command
toolchain.teststringnoneTest command

Example:

yaml
toolchain:
  format: npm run format:check
  lint: npm run lint
  test: npm test

AI model

FieldTypeDefaultDescription
modelstring or object{ small: "haiku", medium: "sonnet", large: "opus" }Claude model(s) for AI review phases

Shorthand — use one model for everything:

yaml
model: sonnet

Expanded — three semantic slots:

yaml
model:
  small: haiku # Quick, mechanical tasks (consolidation, small-PR triage)
  medium: sonnet # Standard review work
  large: opus # Deep architectural reasoning (large/complex PRs only)

The system picks which slot to use based on the phase and PR scope.

Model selection strategy

Caliper uses three model slots (small, medium, large) and selects which to use based on:

PR scope classification:

  • small — <100 changed lines, ≤3 files, no high-risk files
  • normal — everything in between
  • large — >500 changed lines, >10 files, or 3+ high-risk files

Phase-to-slot mapping:

PhaseSmall PRNormal PRLarge PR
Reviewmediummediumlarge
Synthesismediummediumlarge
Crossfile selectsmallsmallsmall
Lensesmediummediumlarge
Consolidatesmallmediummedium
Narrativesmallmediummedium

Lenses

FieldTypeDefaultDescription
lensesstring[]["security"]Lens passes to always run (in addition to auto-triggered lenses)

Available lenses: security, data-integrity, api-contracts, concurrency, design.

Lenses run automatically when risk signals are detected:

  • File path triggers: Migration paths trigger data-integrity; API directories and route files trigger api-contracts; factory/provider/registry files trigger design
  • Diff content triggers: Concurrency primitives trigger concurrency; auth-related keywords trigger security; factory/provider patterns trigger design
  • Structural triggers: 3+ changed files in the same directory triggers design

Auto-triggered lenses are merged with configured lenses — no duplicates.

yaml
lenses:
  - security
  - api-contracts

Advanced tuning

FieldTypeDefaultDescription
costWarningThresholdnumber2Maximum estimated cost (USD) before prompting for confirmation. Set high to disable.
crossfileContextBudgetnumber12000Token budget for cross-file context in synthesis

Review preferences

FieldTypeDefaultOptions
preferences.tonestring"direct""direct" — no hedging; "friendly" — softer phrasing; "terse" — minimal words
preferences.strictnessstring"precise""precise" — only bugs and clear mistakes; "balanced" — also readability and design; "thorough" — everything including style
preferences.nitsbooleantrueWhether to report nitpicks (spacing, naming, import order)
preferences.suggestedFixesstring"always""always" — diff for every finding; "when-clear" — only obvious fixes; "never" — describe only

Project standards

FieldTypeDefaultOptions
standards.testingstring"complex-only""always" — flag any untested function; "complex-only" — only complex logic; "none"
standards.documentationstring"complex-only""public-api" — require docs on exports; "complex-only" — only non-obvious logic; "none"
standards.errorHandlingstring"important-paths""strict" — flag unhandled rejections, empty catches; "important-paths" — I/O, auth, payment; "discretionary"
standards.complexitystring"moderate""strict" — flag long functions, deep nesting; "moderate" — only hard to follow; "none"
standards.loggingstring"important-paths""strict" — log every state change; "important-paths" — error handlers and key ops; "none"
standards.dependenciesstring"justified""strict" — flag every new package; "justified" — only if it duplicates existing; "open"
standards.magicValuesstring"non-obvious""strict" — flag any raw number/string; "non-obvious" — allow 0, 1, ''; "none"
standards.deadCodestring"strict""strict" — unused imports, unreachable branches, commented-out code; "comments-only" — only commented-out blocks; "none"

Conventions and policy customization

.caliper/policy.md — The review policy defines what the AI evaluates against: priority order, engineering criteria, design criteria, and risk classification. You can customize this to match your team's standards.

Regenerating checks

When your CLAUDE.md files change, regenerate the deterministic checks:

bash
npx caliper refresh

Caliper automatically checks for staleness at the start of each PR review and auto-refreshes if artifacts are out of date.

Released under the MIT License.