Local Rust CLI for AI coding workflows

Natural language in.
Perfect AI context out.

Stop manually collecting files for Cursor, Claude Code, Codex, and other coding agents. Describe the job once — Context Compiler ranks the relevant files, trims noise, and produces a paste-ready context pack.

ctx demo
$ ctx "fix the auth race condition"
→ indexing repo if needed…
 Selected 4 files · ~3.1K tokens

  1. src/auth/middleware.ts      92%
  2. src/auth/session-store.ts   78%
  3. src/types/session.ts        71%
  4. tests/auth-race.test.ts     65%

 Context copied to clipboard
100xfaster setup
7xfewer tokens
0cloud APIs required
1command workflow

Install

One command. Safe fallback.

The installer downloads a release binary when one exists. Until public releases are cut, it automatically falls back to building from GitHub source with Cargo.

install.sh
curl -fsSL https://ctx-compiler.getaxiom.ca/install.sh | sh

# then, inside any repo
ctx init
ctx "add tests for the payment webhook"

Workflow

Every instruction is dead simple.

01

Index once

Run ctx init at the root of a project. It creates a local .ctx/ SQLite index.

02

Ask naturally

Run ctx "fix login timeout" or ctx compile -b 16000 "task".

03

Paste and build

The selected files are formatted into a context pack and copied to your clipboard.

Relevance engine

Combines lexical/semantic matching, dependency graph signals, and history from previous sessions.

Smart trimming

Keeps types, signatures, and logic while removing obvious boilerplate and comments.

Private by default

The current MVP uses local embeddings and SQLite. No source code has to leave your machine.

GitHub accurate

Docs now match the actual CLI: ctx init, ctx compile, shorthand ctx "task", status/history/done/watch.

Wiki

Context Compiler Wiki

Quickstart

  1. Install with the command above.
  2. Open your codebase root.
  3. Run ctx init.
  4. Run ctx "describe the feature or bug".
  5. Paste the generated context into your coding agent.

Commands

  • ctx init — create the local index.
  • ctx "task" — shorthand compile with default budget.
  • ctx compile -b 16000 -m 8 "task" — custom token budget and file limit.
  • ctx status — show indexed files/languages/history.
  • ctx reindex — rebuild from scratch.
  • ctx history / ctx done — view and save task history.
  • ctx watch — periodically rebuild while files change.

Recipes

ctx "find where user sessions are created"
ctx compile --budget 12000 --output context.md "refactor payment webhook"
ctx reindex && ctx status

Troubleshooting

  • If install says Cargo is missing, install Rust from rustup and rerun.
  • If output seems stale, run ctx reindex.
  • If clipboard access fails in a headless shell, use ctx compile -o context.md "task".
  • Do not commit .ctx/; it is local cache data.

Verification

Audited against the real repo.

Rust dependency versions corrected so the project builds.
Missing CLI module declaration removed.
Shorthand ctx "task" implemented to match docs.
Relevance matching improved and smoke-tested on this repo.
Install script no longer fails just because no release exists yet.