Selvage: AI-Powered Code Review Automation Tool
🌐 한국어
A modern CLI tool that helps AI analyze Git diffs to improve code quality, find bugs, and identify security vulnerabilities.
🤖 AI Agents: Read our documentation at https://selvage.ai/llms.txt
▶ Watch Demo Video
Selvage: Code reviews with an edge!
No more waiting for reviews! AI instantly analyzes your code changes to provide quality improvements and bug prevention.
With smart context analysis (AST-based) that's accurate and cost-effective, plus multi-turn processing for large codebases - seamlessly integrated with all Git workflows.
Table of Contents
✨ Key Features
- 🤖 Multiple AI Model Support: Leverage the latest LLM models including OpenAI GPT-5, Anthropic Claude Sonnet-4, Google Gemini, and more
- 🔍 Git Workflow Integration: Support for analyzing staged, unstaged, and changes between specific commits/branches
- 🎯 Optimized Context Analysis: Tree-sitter based AST analysis automatically extracts the smallest code blocks containing changed lines along with their dependency statements, providing contextually optimized information for each situation
- 🔄 Automatic Multi-turn Processing: Automatic prompt splitting when context limits are exceeded, supporting stable large-scale code reviews (Large Context Mode now auto-triggers once total tokens exceed 200k, even without provider errors)
- 🤖 MCP Mode Support: Register as MCP mode in Cursor, Claude Code, etc., and request code reviews through natural language like "Review current changes"
- 🔌 Claude Code Plugin: Install via marketplace with a single command — includes dedicated
/review skill and selvage-reviewer agent for seamless integration
- 🧠 Agent-Delegated Review (
get_review_context): Returns structured review context (diff + Smart Context + system prompt) so host agents (Claude Code, Cursor, Antigravity, etc.) can perform code reviews with their own LLM — no API key required
- 📖 Open Source: Freely use and modify under Apache-2.0 License
🚀 Quick Start
Common Setup
1. Installation
Recommended Method (using uv)
# Install uv (run once)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install Selvage
uv tool install selvage
Alternative Method (using pipx)
# Install pipx (macOS)
brew install pipx
# Install Selvage
pipx install selvage
Traditional Method (pip)
# ⚠️ May cause externally-managed-environment error on some systems
pip install selvage
macOS/Linux users: If you encounter errors with pip install, please use the uv or pipx methods above.
2. API Key Setup
Get an API key from OpenRouter and set it up:
export OPENROUTER_API_KEY="your_openrouter_api_key_here"
MCP Mode Usage (Recommended)
Register as MCP mode in Cursor, Claude Code, etc., to request code reviews through natural language.
Cursor Integration
Register in Cursor's MCP configuration file (path may vary depending on user environment):
Common path: ~/.cursor/mcp.json
// Method 1: Using environment variables (if already set)
{
"mcpServers": {
"selvage": {
"command": "uvx",
"args": ["selvage", "mcp"]
}
}
}