ctx is a command-line tool and MCP server that answers one kind of question well: which files does this task actually need? It builds a local, deterministic index of your repository — symbols, files, and the dependency edges between them — and lets you (or an AI agent) query it over stdio.
Install via npm (no Rust toolchain needed):
npm install -g ctxai-cli ctx init ctx context "what does the payment module do?"
Or from source with cargo:
cargo install ctxai-cli --locked ctx init
| Command | What it does |
|---|---|
| ctx init | Index the current directory into .ctx/. Incremental, so later runs are fast. |
| ctx doctor | Verify the index is healthy and current. |
| ctx context "…" | Build a relevance-ranked context package for a task description. |
| ctx mcp | Run the MCP server so an AI agent can query the graph. |