# archex

A local, deterministic tool that assembles a ranked, token-budgeted bundle of code context for AI coding agents up front, along with a receipt recording what was included, what was skipped, and whether the bundle is complete enough to act on.

archex performs retrieval and structural expansion of a codebase before an agent starts working, rather than letting the agent discover context by following imports and searches one file at a time. It runs entirely locally using deterministic retrieval and static analysis, needing no hosted inference or API key, and supports many languages across full, structured and chunk-only analysis tiers, including a dependency-graph plugin for Maven POM files.

It is reachable through a command-line interface, an MCP server, a Python API, and Docker, and adds optional, non-blocking tool-call hooks for several coding-agent clients that augment their search and file-reading calls with archex's own results, or log a diagnostics-only trace when a client has no matching hook. Output can be formatted as JSON, with unset or empty fields dropped by default, or as a more token-efficient encoding.

It is written in Python.

Website: https://github.com/Mathews-Tom/archex
