Documentation

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.

Quick start

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

The core loop

CommandWhat it does
ctx initIndex the current directory into .ctx/. Incremental, so later runs are fast.
ctx doctorVerify the index is healthy and current.
ctx context "…"Build a relevance-ranked context package for a task description.
ctx mcpRun the MCP server so an AI agent can query the graph.

Next steps