Local Rust CLI v0.3.0

Tell it what to build.
Get the right files.

Context Compiler turns a plain-English task into a ranked, token-budgeted context pack for any AI coding agent — Cursor, Claude Code, Codex, Copilot, or ChatGPT.

$ curl -fsSL https://ctx-compiler.getaxiom.ca/install.sh | sh
Full install guide →
ctx "fix missing import in App.tsx"
→ indexing 53 files…
 Selected 5 files · ~9.7K tokens

  1. src/lib/repos.ts           63%  BM25
  2. src/App.tsx                61%  filename
  3. src-tauri/src/repos.rs     33%  identifier
  4. src/hooks/useRepos.ts      28%  BM25
  5. src/types/index.ts         29%  dependency

 Context copied to clipboard

How it works

From task to context pack in seconds.

You describe the work. Context Compiler scores every file in the repo and produces a paste-ready pack — trimmed to your token budget.

1. You describe the task

Plain English. Mention files by name if you know them. A task like "fix the auth timeout in userSession.ts" works perfectly.

2. Scoring pipeline runs

Stage 1: FTS5 BM25 lexical search over paths, summaries, and identifiers.
Stage 2: Filename boost — exact matches jump to the top.
Stage 3: Compound identifier match (CamelCase, snake_case).
Stage 4: Import-graph dependency propagation.
Stage 5: Optional AI reranker with your provider key.

3. Paste and build

Ranked files are trimmed to fit your token budget, formatted into a context pack, and copied to your clipboard. Paste directly into any AI coding agent.

Install

Up and running in 30 seconds.

One command installs the binary. Then ctx init and ctx "task" are all you need.

1

Install the CLI

Downloads a release binary for your platform. Falls back to building from source if no binary exists yet.

2

Index your project

ctx init creates a local .ctx/ SQLite index. Add .ctx/ to .gitignore

3

Start compiling

ctx "your task here" compiles context and copies it to your clipboard.

4

Optional: add an AI provider

Add an API key to unlock Stage 5 AI reranking for maximum accuracy. No key needed to use the tool.

install & run
# Install (one command)
curl -fsSL https://ctx-compiler.getaxiom.ca/install.sh | sh

# Or with options
curl -fsSL ...install.sh | sh -s -- --version
curl -fsSL ...install.sh | sh -s -- --dry-run

# Index your project
$ cd ~/my-project
$ ctx init
→ indexing 147 files…
✓ Indexed 147 files

# Compile context
$ ctx "add webhook retry logic"
→ 5-stage scoring pipeline…
✓ Selected 6 files · ~8.4K tokens
✓ Context copied to clipboard

# Set an API key (optional)
$ ctx configure --provider openrouter --api-key sk-or-...

Use cases

Real tasks, real results.

These are actual tasks taken from real migrations and bug fixes. Context Compiler found the right files every time.

"fix the race condition in auth middleware"
bug fix4 files selected
  • 1 src/auth/middleware.rs BM25 80%
  • 2 src/auth/session.rs dependency 72%
  • 3 src/auth/mod.rs identifier 51%
  • 4 src/db/users.rs BM25 42%
"implement Stripe webhook signature verification"
feature6 files selected
  • 1 src/billing/webhook.rs filename 91%
  • 2 src/billing/signature.rs identifier 83%
  • 3 src/billing/mod.rs BM25 67%
  • 4 src/config/secrets.rs dependency 54%
"refactor user auth flow and add tests"
refactor8 files selected
  • 1 src/auth/mod.rs filename 94%
  • 2 src/auth/middleware.rs BM25 88%
  • 3 tests/auth_test.rs filename 81%
"add TypeScript strict mode to frontend build"
config5 files selected
  • 1 tsconfig.json filename 95%
  • 2 vite.config.ts BM25 79%
  • 3 src/main.tsx identifier 64%
"fix memory leak in WebSocket handler"
bug fix3 files selected
  • 1 src/ws/handler.ts filename 92%
  • 2 src/ws/connection.ts identifier 74%
"migrate database schema to add user preferences table"
migration7 files selected
  • 1 migrations/20260531_add_prefs.sql filename 97%
  • 2 src/models/user.rs BM25 82%
  • 3 src/db/schema.rs identifier 71%

Accuracy

Tested across dozens of real repos.

We ran Context Compiler against real repositories with realistic developer tasks. Here's how it performs with and without an AI API key.

Without API key (local only)
54.5%
Expected-file recall

Stages 1-4: FTS5 BM25 lexical search, filename boost, identifier matching, and dependency propagation. Works completely offline. Tested against 26 real repositories.

With 1 AI provider
91%
Expected-file recall

All 5 stages including AI reranking. A single provider rescores the top 30 and catches what local scoring misses.

With ensemble (2 providers)
94%
Expected-file recall

Two providers vote independently. If either marks a file CRITICAL, it jumps to the top. Minimal false negatives.

Junk artifacts
0%
Selected in results

target/, node_modules/, dist/, .next/, and other build artifacts are excluded from indexing and never appear.

How we measure

For each test case, a developer writes a realistic task and a list of files they'd manually select for that task. We run ctx compile "task" against a temp copy of the repo, then check whether the expected files appear in the results. Each repo is indexed fresh for every test run. No cheating.

Repos tested: context-compiler, axiom-workspace, axios, next.js, tauri, react, tokio, clap, vite, redis-py, express, laravel, django, rust-analyzer, neovim, raycast, obsidian, and more.

Providers

Works with any AI provider. Or none at all.

The 4-stage local pipeline works with zero configuration. Add any API key to unlock Stage 5 AI reranking for maximum accuracy.

Local only

No API key needed

  • FTS5 BM25 lexical search
  • Filename & identifier matching
  • Dependency graph propagation
  • Task history learning
  • ~75% accuracy on expected files
ctx init then ctx "task"

OpenRouter

Access 100+ models

  • Everything in Local
  • + Multi-model reranking
  • + Same OpenAI-compatible API
  • ~91% accuracy on expected files
ctx configure --provider openrouter --api-key sk-or-...

DeepSeek

Fast & cost-effective

  • Everything in Local
  • + DeepSeek reranking
  • + Embedding support
  • ~90% accuracy on expected files
ctx configure --provider deepseek --api-key sk-...

Generic / self-hosted

Ollama, vLLM, etc.

  • Everything in Local
  • + Any OpenAI-compatible API
  • + Custom base URL
  • Depends on model quality
ctx configure --provider generic --api-key ... --base-url http://localhost:1234/v1

Commands

Every command at a glance.

Core workflow

ctx initIndex the current repo
ctx "task"Compile context (default budget)
ctx compile -b 16000 "task"Custom token budget
ctx compile -m 10 "task"Limit number of files
ctx compile -o ctx.md "task"Write to file

Inspect & manage

ctx statusShow index stats
ctx reindexRebuild from scratch
ctx watchAuto-reindex on changes
ctx history -l 20View past compilations
ctx doneMark task complete

Configure

ctx configure --provider ... --api-key ...Set AI provider
ctx providersList configured providers
ctx configure --showShow current config
ctx completions bashShell completions