sift-review
v0.8.2
Published
Pre-commit AI code review for Claude Code
Maintainers
Readme
Sift reviews your code before it leaves your machine. It filters noise from diffs, maps the blast radius of your changes, and gives you a plain-English summary — all in your terminal.
What You Get
The Diff — A noise-collapsed view showing only meaningful changes. Whitespace, import reordering, formatting, and comment-only changes are filtered out.
The Flow — Call graph visualization showing which files are affected downstream. Built using lightweight static analysis for TypeScript and Python.
The Why — Three lines of plain-English explanation: Problem, Fix, Risk. Max 25 words per line.
Example Output
Summary
Problem: Auth middleware stores session tokens in plaintext cookies
Fix: Switched to httpOnly signed cookies with 24h expiry
Risk: Existing sessions will be invalidated on deploy
Blast radius: 3 files changed, 2 affected downstream
┌─────────────────────────────────────────────────┐
│ src/middleware/auth.ts (setSession) CHANGED │
└──────────────────────┬──────────────────────────┘
│
v
┌──────────────────────────────┐
│ src/routes/api.ts → handler │
└──────────────────────────────┘
2 issues found:
! src/middleware/auth.ts:42 Cookie maxAge is set in ms but comment says seconds
! src/middleware/auth.ts:58 No CSRF token validation on session refresh endpoint
Confidence: 82% | +34 -12 | 8 noise lines filtered
Tokens: 1,247 in / 312 out | Est. cost: $0.0085Quick Start
Claude Code (MCP Server)
Install sift and register it as an MCP server in one step:
npm install -g sift-review
claude mcp add sift -- sift-mcpRestart Claude Code, then just say "review my changes". Sift auto-discovers your repo and runs the review. It also runs automatically before any git push.
Without a global install:
claude mcp add sift -- npx -y sift-review sift-mcp
CLI
# Review changes on your current branch
sift review
# Review against a specific base
sift review --base main
# Specify both base and head
sift review --base main --head feature-branch
# Run without installing
npx sift-review reviewRequirements
- Node.js >= 20
- Git
ANTHROPIC_API_KEYorANTHROPIC_AUTH_TOKENenvironment variable set
MCP Tools
When running as an MCP server, sift exposes these tools to Claude Code:
| Tool | Description |
|------|-------------|
| review_diff | Run a full AI code review (auto-discovers repos) |
| get_blast_radius | Get the call graph showing downstream impact |
| get_file_details | Drill into a specific file's changes |
| get_diff_page | Page through the diff one file at a time |
| discover_repos | Scan a directory for git repos with changes |
Configuration
Create an optional .sift.json at your project root:
{
"model": "claude-sonnet-4-6-20250514",
"max_diff_lines": 500,
"base_branch": "main",
"max_issues": 10
}| Field | Default | Description |
|-------|---------|-------------|
| model | claude-sonnet-4-6-20250514 | Claude model for analysis |
| max_diff_lines | 500 | Max diff lines sent to Claude |
| base_branch | main | Default base branch for diffing |
| max_issues | 10 | Max issues to return |
| api_key_env | ANTHROPIC_API_KEY | Environment variable name for the API key |
Proxy / LiteLLM Support
Sift works with LiteLLM and other Anthropic API-compatible proxies. Set the standard environment variables:
export ANTHROPIC_BASE_URL=https://your-proxy.example.com/
export ANTHROPIC_AUTH_TOKEN=your-tokenThen configure the model name in .sift.json:
{
"model": "your-proxy-model-name"
}The Anthropic SDK reads these environment variables automatically — no additional sift configuration needed. Cost estimation is disabled when using a proxy.
How It Works
- You run
sift review(or it runs via a pre-push hook) - Sift extracts the diff between your branch and the base
- Noise is filtered out — whitespace, import reordering, formatting, comments
- The filtered diff is sent to Claude for review
- Static analysis builds a call graph showing affected downstream files
- AI review and graph building run in parallel
- Results are formatted and displayed in your terminal
Bypass
git push --no-verify