Skip to main content

codey

PyPI Python License: MIT

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 both codey.

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:

  1. Compute current HEAD hash
  2. If already indexed → no-op (cache hit)
  3. Otherwise reuse file entries from the last indexed hash whose content hash hasn't changed; re-parse only changed files
  4. 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

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

codey_review-0.1.0.tar.gz (141.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codey_review-0.1.0-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

Details for the file codey_review-0.1.0.tar.gz.

File metadata

  • Download URL: codey_review-0.1.0.tar.gz
  • Upload date:
  • Size: 141.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

Hashes for codey_review-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a68371f1755d0c21d69ad178759c9404a140726bdb9159430e6dcbea86325f8b
MD5 59fab28b09a48f93a238b969a61f2702
BLAKE2b-256 57618fb297ba5b8b87be47150f9f4d25a4e2cf01b829adacaabf1f6fb9ad3623

See more details on using hashes here.

File details

Details for the file codey_review-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: codey_review-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 58.0 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

Hashes for codey_review-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac3acb8e1718fe71cf912e7ba277449b574b7a1b9e575d72ba494701be854db5
MD5 9342ebdd0754495a1f754061ba927c19
BLAKE2b-256 6e172498b82d62d3691c20d0234fe82c69b929c57fdca44cd36460ee667314b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page