codey
Production-grade multi-agent AI code review system.
Codey orchestrates specialized agents — security, code quality, testing, and indexing — over your local git diff, with tree-sitter AST caching and jedi-based reverse-dependency lookup. Built on LangGraph.
codey set # configure provider & API key (OpenAI / Anthropic / DeepSeek / Google / custom)
codey model # view or switch the active model
codey config # show current configuration
codey review # review the latest commit in the local repo
Features
- Multi-agent review: LangGraph supervisor fans out to 4 specialist agents in parallel, each emitting a structured standalone report
- AST-aware caching: tree-sitter parses files once; subsequent runs diff against the last git-hash and re-parse only changed files (sqlite at
~/.cache/codey/codey.db) - Reverse-dependency lookup (Python v1): jedi call graph finds files that import or call into changed code, sending affected-but-unmodified chunks to the LLM for verification
- AST-aware diff chunking: large diffs are broken into function/class-level chunks mapped via the cached symbol table
- Context window budgeting: cheap/fast summarizer model condenses very large diffs; chunks are pruned to fit the model's token budget
- Security analysis: runs
bandit(Python),semgrep(multi-language),gitleaks(secrets) — skips files that obviously don't affect security (css, images, lock files); LLM synthesizes raw tool output into structured findings - Code quality benchmarking: compares the diff against the indexed codebase's architecture/design conventions
- Test execution: auto-detects the test framework (pytest, npm, go, cargo, rake); skips cleanly if no test suite is identifiable
- Live progress: rich terminal updates as each agent starts and finishes
- Rich rendering: final summary as markdown with severity-coloured findings table; interactive standalone report viewer (
--report)
Install
pip install codey-review
Or with uv:
uv tool install codey-review
Note: The PyPI package name is
codey-review, but the CLI command and Python import are bothcodey.
Quickstart
codey set # pick a provider, enter your API key, choose models
codey review # review the latest commit (HEAD~1..HEAD)
How it works
┌──────────────────────────────────────────────────────────┐
│ Codey Review Pipeline │
│ │
│ git diff ──► AST chunker ──► diff chunks (per-symbol) │
│ │ │
│ reverse-dep lookup ──► dependent file sources │
│ │ │
│ ┌────────▼─────────┐ │
│ │ LangGraph supervisor │
│ │ ┌─────────────┐ │ │
│ │ │ IndexAgent │─┼──► architecture summary │
│ │ └──────┬──────┘ │ │
│ │ │ │ (parallel fan-out) │
│ │ ┌──────▼──────┐ │ │
│ │ │SecurityAgnt │ │ ─► bandit/semgrep/gitleaks │
│ │ │CodeQualitAgt│ │ ─► convention benchmarks │
│ │ │ TestAgent │ │ ─► pytest/npm/go/cargo │
│ │ └──────┬──────┘ │ │
│ │ │ │ │
│ │ ┌──────▼──────┐ │ │
│ │ │ CodeyAgent │─┼──► final ReviewSummary │
│ │ └─────────────┘ │ (markdown + recommendation)│
│ └──────────────────┘ │
│ │ │
│ rich terminal render │
└──────────────────────────────────────────────────────────┘
Agents
| Agent | Role | LLM | Tools | Skips |
|---|---|---|---|---|
| index | Repo indexer + architecture summary | ✓ | tree-sitter, jedi | — |
| security | Vulnerability & secret detection | ✓ | bandit, semgrep, gitleaks | css, md, images, fonts, lock files |
| code_quality | Convention & pattern benchmarks | ✓ | — | when no diff provided |
| test | Test suite identification & execution | ✓ | pytest, npm, go, cargo, rake | when no framework detectable |
| codey (supervisor) | Executive synthesis + retrieval | ✓ | grep, cat, ls, git (via react-agent) | — |
Structured findings
Every agent emits a pydantic AgentReport containing Finding objects with severity, category, title, file_path, line_start, evidence, recommendation, and confidence (0-1). The orchestrator aggregates these into a ReviewSummary with an overall severity and a recommendation of approve, request_changes, or block.
Cache
The AST/symbol cache lives at ~/.cache/codey/codey.db (sqlite, WAL mode), keyed by absolute repo path. On each review:
- Compute current HEAD hash
- If already indexed → no-op (cache hit)
- Otherwise reuse file entries from the last indexed hash whose content hash hasn't changed; re-parse only changed files
- Fresh symbols + call edges + import edges stored for the new hash
Development
git clone https://github.com/arihant/codey
cd codey
uv sync
uv run pytest tests/ -v
uv run ruff check codey/
Package
- PyPI: https://pypi.org/project/codey-review/
- Install:
pip install codey-review - Python import:
import codey - CLI command:
codey --help
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codey_review-0.2.0.tar.gz.
File metadata
- Download URL: codey_review-0.2.0.tar.gz
- Upload date:
- Size: 159.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52a65dd90cb2dd348bc78f741845fad76b1ab02de666b0a1bfe48c4613af5c50
|
|
| MD5 |
e2e75b1cb181d3c5a72537be1251f705
|
|
| BLAKE2b-256 |
67dd0b45d5b220fc21a72ca5bffcb676e7e19f1b2fae5d9633290c482f5615c7
|
File details
Details for the file codey_review-0.2.0-py3-none-any.whl.
File metadata
- Download URL: codey_review-0.2.0-py3-none-any.whl
- Upload date:
- Size: 76.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce3c937ed086d1f64672cab9e2fa4665d7e66e8fc8217f4d620493c334fcc56
|
|
| MD5 |
960462c8523ca39796079c5b825cd653
|
|
| BLAKE2b-256 |
98ffa57ada394f0f48d64e50046f130654add0f72eb1f5b288cd807ea0bfb833
|