codey
Production grade multi-agent AI code review system. Codey orchestrates four specialist agents (security, code quality, testing, indexing) over a commit diff, then emits a structured verdict with a recommendation.
Built on LangGraph with tree-sitter AST caching and jedi based reverse dependency lookup.
Install
Codey requires Python 3.13+.
pip install codey-review
Or with uv:
uv tool install codey-review
The package on PyPI is named codey-review. The CLI command and Python import are both codey.
Quick start
codey set # configure provider, API key, and models
codey review # review the latest commit (HEAD~1..HEAD)
codey review <commit> # review a specific commit
Commands
| Command | Purpose |
|---|---|
codey set |
Configure provider, API key, and models interactively |
codey unset [PROVIDER] |
Remove a provider's credentials and configuration |
codey model |
View or switch the active model |
codey config |
Show configuration or toggle commit summary append |
codey graph |
Inspect the indexed symbol, call, and import graph |
codey review [COMMIT] |
Review a commit, latest by default |
codey review options: --no-progress, --force-index, --run-tests (requires confirmation), --json (machine readable output for CI).
Providers
| Provider | API key | Models |
|---|---|---|
| OpenAI | required | gpt-4.1, gpt-4.1-mini, gpt-4o, o3-mini |
| Anthropic | required | Claude Sonnet, Haiku, Opus |
| DeepSeek | required | deepseek-chat, deepseek-reasoner |
| required | Gemini 2.5 Pro, Gemini 2.0 Flash | |
| Custom (OpenAI compatible) | required | any endpoint via base_url |
| Local | none | Ollama, LM Studio, llama.cpp, vLLM via /v1 |
codey set and codey model fetch the live model list from each provider's API and fall back to the bundled list when the provider is unreachable.
Features
Security analysis
- Deterministic hardcoded secret detector with prefix rules and Shannon entropy filtering. Scans the raw diff, never an LLM summary.
- Optional bandit (Python), semgrep (multi-language), and gitleaks (secrets, scoped to the commit).
- LLM confidentiality judgement for issues with no regex anchor: PII, internal endpoints, weak crypto, command injection, leaking logs.
Code quality
- Benchmarks the diff against conventions found in the indexed codebase: naming, typing, docstrings, error handling, structure.
- Verbatim evidence enforcement. Findings without a real code snippet are discarded.
Testing
- Detects the test framework automatically: pytest, npm, go, cargo, rake.
- Opt in execution via
--run-testswith an explicit confirmation. Repo code is never run implicitly.
Indexing and caching
- tree-sitter parsing cached in SQLite at
~/.cache/codey/codey.db, keyed by git hash. Only changed files are re-parsed. - jedi based call graph with reverse dependency lookup that surfaces affected but unmodified files to the review.
Review pipeline
- AST aware diff chunking at function and class granularity.
- Context window budgeting with a cheap summarizer for large diffs. Pruned ranges are reported, never silently dropped.
- LangGraph DAG fans out to the security, code quality, and test agents in parallel.
Output
- Rich terminal report with a severity colored findings table and per agent overview.
--jsonfor CI gates and machine readable consumption.- Optional append of the summary to the reviewed commit message, HEAD only.
Architecture
flowchart TD
CLI["codey review"] --> CFG["Load config and LLMs"]
CFG --> GIT["git diff and changed files"]
GIT --> WT{"Non-HEAD commit?"}
WT -->|yes| WORKTREE["Materialize worktree"]
WT -->|no| SCAN["Working tree"]
WORKTREE --> SCAN
SCAN --> IDX["Index agent<br/>tree-sitter symbols and jedi call graph<br/>SQLite cache"]
IDX --> CHUNK["Chunk diffs by symbol"]
CHUNK --> SUM["Summarize large diffs<br/>cheap model"]
SUM --> BUDGET["Prune to context budget"]
BUDGET --> DEPS["Reverse dependency lookup"]
DEPS --> DAG
subgraph DAG["LangGraph DAG"]
I["index"] --> S["security"]
I --> Q["code quality"]
I --> T["test"]
S --> C["codey orchestrator"]
Q --> C
T --> C
end
C --> OUT["ReviewSummary<br/>severity and recommendation"]
OUT --> RICH["Rich terminal report"]
OUT --> JSON["--json output"]
The index agent builds the symbol table and architecture summary first. Security, code quality, and test agents then run in parallel. The codey orchestrator synthesizes their reports into a final verdict. A deterministic recommendation is computed first, and the LLM can only make it stricter, never more optimistic.
Development
git clone https://github.com/arihant/codey
cd codey
uv sync
uv run pytest tests/
uv run ruff check codey/
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.1.tar.gz.
File metadata
- Download URL: codey_review-0.2.1.tar.gz
- Upload date:
- Size: 171.5 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 |
f3295367fd58d8e03d059110363076267831b1139e2896302a35cc083eb88589
|
|
| MD5 |
b0e8c0ba6fd9de26cbac22ad79d3da4e
|
|
| BLAKE2b-256 |
2843038039a5fe519d04e65389c5e694676abcf04cef745f934014b2fcdbbf36
|
File details
Details for the file codey_review-0.2.1-py3-none-any.whl.
File metadata
- Download URL: codey_review-0.2.1-py3-none-any.whl
- Upload date:
- Size: 70.6 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 |
29b1a899c00591654805a5952e3fc89abddb76fbfe9b10e12afcd28e499ba55b
|
|
| MD5 |
52350f0644e3925c1513f800182c331d
|
|
| BLAKE2b-256 |
77996b7a799c3d53220fd7c1e9b278ffadc52412fa8e55b1c7290373e303bd63
|