Appearance
CaliperYour CLAUDE.md rules are instructions for an AI that forgets.
Convention checks after every agent turn. AI review before every commit. Full pipeline before every merge.
Convention checks after every agent turn. AI review before every commit. Full pipeline before every merge.
By turn 5, your agent is borrowing patterns from training data, not your codebase.
Caliper compiles your CLAUDE.md into deterministic checks that run after every agent turn — sub-second, free, no API calls. When the agent drifts, Caliper catches it before the mistake compounds into the next ten files. AI review catches what deterministic checks can't: missing awaits, race conditions, security holes, and code that's quietly drifted from your repo's established patterns — all before the code ever leaves your machine.
npx caliper init reads your CLAUDE.md, compiles every mechanically checkable convention into a deterministic rule, and installs a Claude Code stop hook. Every time your agent completes a turn, Caliper checks its output — sub-second, free, no API calls. The agent sees the violations and fixes them before writing the next file.
## Code Style
- No classes — use functions and plain objects
- Keep functions under ~30 lines
- Never use execSync with template strings
## Architecture
- Always use the project's httpClient — never use raw fetch()
- Every file in src/api/ must have a .test.ts file
- All database writes must be awaited╭─── Claude Code v2.1.76 ──────────────────────────────────────────────────────╮ │ │ │ Welcome back! │ │ │ │ ▗ ▗ ▖ ▖ │ │ │ │ ▘▘ ▝▝ │ │ Sonnet 4.6 (1M context) · Claude Max · │ │ ~/my-project │ ╰────────────────────────────────────────────────────────────────────────────────╯
Your conventions are already written in CLAUDE.md. Caliper turns them into enforcement at three levels — each narrowing what the next needs to evaluate.
| Layer | When it runs | AI calls? |
|---|---|---|
| Convention checks | After every agent turn, via stop hook | No — free, sub-second |
| AI review | Before commit, via npx caliper review or pre-commit hook | Yes — uses your Anthropic API key |
| Full pipeline | Before every merge, via npx caliper <pr> | Yes — multi-phase with specialized lenses |
Convention enforcement is always free. AI review catches what deterministic checks can't — missing await, race conditions, security holes, and code out of compliance with your repo's established patterns. How it all fits together →
Caliper doesn't charge anything. You bring your own Anthropic API key and choose the model. Convention checks require one API call to compile your CLAUDE.md — after that, they run locally with no API calls. AI review uses your key at whatever model you select.
Before you create a PR, npx caliper review runs a full AI review on your staged changes. Missing an await, bypassing your HTTP client, introducing a subtle race condition — things that can't be caught mechanically. Run it manually or wire it into a pre-commit hook for automatic enforcement. You review each finding interactively and apply fixes with --fix. Issues get resolved locally, before they ever reach a reviewer.
await on database write — order silently not saveddb.orders.insert(order) returns a Promise, but the result isn't awaited. The customer sees a confirmation page, but the order never persists. fetch() bypasses the project's HTTP clientfetch() directly instead of using httpClient from src/infra/http.ts. The project's HTTP client adds auth headers, retry logic, and circuit-breaking. When a PR is ready, Caliper runs a multi-phase review with specialized lenses for security, data integrity, API contracts, concurrency, and design. Findings are posted as inline GitHub comments. You approve each finding before it's posted.
Compiled grep and AST checks run in your shell. No code is transmitted. No API key required. Works air-gapped.
Only the changed lines and surrounding function context are sent to the Anthropic API. Not your full codebase, not your git history, not your environment.
Caliper is a CLI tool that runs in your environment. Anthropic's API does not use inputs for training. State and history stay on your machine.
| What it does | What it doesn't do | |
|---|---|---|
| ESLint / Semgrep | Enforces language-level rules: formatting, unused imports, generic security patterns. | Doesn't know your project. Can't enforce "use our HTTP client, not raw fetch" or "every migration needs a test." |
| CLAUDE.md | Tells the agent your conventions in plain English. | The agent forgets them as context fills up. By turn 10 it's borrowing patterns from training data, not your codebase. No enforcement mechanism. |
| CodeRabbit / PR bots | Reviews code at merge time. Catches issues in the final diff. | Reviews happen after the agent has already written 15 files with the same bad pattern. Too late to prevent drift — only reports it. |
| Caliper | Compiles your CLAUDE.md into deterministic checks that run after every agent turn. Adds AI review before commit. Full pipeline with specialized lenses before merge. | Not a linter replacement — complements them. Stop double-checking Claude — spend your review time on judgment, not pattern-matching. |
The gap in the current stack: no tool enforces your project-specific conventions at the speed agents produce code. Linters are generic. CLAUDE.md is aspirational. PR bots are too late. Caliper fills the gap between "we wrote down our standards" and "our standards are actually enforced."
When you approve or skip findings during review, Caliper records those decisions. High-skip-rate patterns get deprioritized. High-approval patterns get promoted. The review calibrates to what your team actually cares about.
The result is a flywheel: use your AI agent → correct its mistakes → Caliper captures your conventions → new checks prevent repeat mistakes → the agent produces better code over time.
Takes ~2 minutes. Caliper compiles your conventions into checks, installs the Claude Code stop hook, and you're done — enforcement is automatic from that point on.
awaiton database write — order silently not saveddb.orders.insert(order)returns a Promise, but the result isn't awaited. The customer sees a confirmation page, but the order never persists.Suggested fix