🐍 🏠 - LLM-based code review with AST-based context extraction, supporting Claude, GPT, Gemini and other…
Selvage: AI-Powered Code Review Automation Tool
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
🌐 한국어
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
- 🚀 Quick Start
- 🎯 Practical Usage Guide
- MCP Mode Usage
- ⌨️ CLI Usage
- 🌐 Smart Context Analysis and Supported AI Models
- 🎯 Smart Context Analysis
- Supported AI Models
- 📄 Review Result Storage Format
- 🔧 Troubleshooting
- 🤝 Contributing
- 📜 License
- 📋 Change Log
- 📞 Contact and Community
✨ 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)**
**Alternative Method (using pipx)**
**Traditional Method (pip)**
**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:
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
Claude Code Integration
Method A: Plugin via Marketplace (Recommended)
Install the Selvage plugin from the marketplace to get the dedicated /review skill and selvage-reviewer agent:
After installation, use the /review skill directly:
> 💡 **No API key required!** The plugin uses get_review_context to leverage Claude Code's own LLM for code review, so no external API key is needed.
Method B: MCP Server Registration
Usage
After restarting your IDE, request reviews from your Coding Assistant:
🎉 **Done!** Selvage will analyze the code, review it, and deliver results through your Coding Assistant.
CLI Mode Usage
For direct terminal usage:
**💡 More Options:** CLI Usage | Practical Usage Guide
---
🎯 Practical Usage Guide
MCP Mode Usage
Basic Usage
Agent-Delegated Review (No API Key Required)
The get_review_context tool returns structured review context so host agents can perform code reviews with their own LLM — **no Selvage API key needed**.