Skip to main content

codey

PyPI Python License: MIT

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
Google 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-tests with 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.
  • --json for 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

Metadata

Release files for codey-review 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codey-review 0.2.1
File Size Uploaded
codey_review-0.2.1.tar.gz 171.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for codey-review 0.2.1
File Interpreter ABI Platform
codey_review-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 242.1 kB

Release files / codey_review-0.2.1.tar.gz

Download URL codey_review-0.2.1.tar.gz
Size 171.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f3295367fd58d8e03d059110363076267831b1139e2896302a35cc083eb88589
BLAKE2b-256 checksum
How to use checksums
2843038039a5fe519d04e65389c5e694676abcf04cef745f934014b2fcdbbf36
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / codey_review-0.2.1-py3-none-any.whl

Download URL codey_review-0.2.1-py3-none-any.whl
Size 70.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29b1a899c00591654805a5952e3fc89abddb76fbfe9b10e12afcd28e499ba55b
BLAKE2b-256 checksum
How to use checksums
77996b7a799c3d53220fd7c1e9b278ffadc52412fa8e55b1c7290373e303bd63
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page