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
→ 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.
Install the CLI
Downloads a release binary for your platform. Falls back to building from source if no binary exists yet.
Index your project
ctx init creates a local .ctx/ SQLite index. Add .ctx/ to .gitignore
Start compiling
ctx "your task here" compiles context and copies it to your clipboard.
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 (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.
- 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%
- 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%
- 1 src/auth/mod.rs filename 94%
- 2 src/auth/middleware.rs BM25 88%
- 3 tests/auth_test.rs filename 81%
- 1 tsconfig.json filename 95%
- 2 vite.config.ts BM25 79%
- 3 src/main.tsx identifier 64%
- 1 src/ws/handler.ts filename 92%
- 2 src/ws/connection.ts identifier 74%
- 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.
Stages 1-4: FTS5 BM25 lexical search, filename boost, identifier matching, and dependency propagation. Works completely offline. Tested against 26 real repositories.
All 5 stages including AI reranking. A single provider rescores the top 30 and catches what local scoring misses.
Two providers vote independently. If either marks a file CRITICAL, it jumps to the top. Minimal false negatives.
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.
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"OpenAI
gpt-4o-mini reranking
- Everything in Local
- + AI reranker for top-30
- + Embedding similarity
- ~91% accuracy on expected files
ctx configure --provider openai --api-key sk-...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/v1Commands
Every command at a glance.
Core workflow
ctx initIndex the current repoctx "task"Compile context (default budget)ctx compile -b 16000 "task"Custom token budgetctx compile -m 10 "task"Limit number of filesctx compile -o ctx.md "task"Write to fileInspect & manage
ctx statusShow index statsctx reindexRebuild from scratchctx watchAuto-reindex on changesctx history -l 20View past compilationsctx doneMark task completeConfigure
ctx configure --provider ... --api-key ...Set AI providerctx providersList configured providersctx configure --showShow current configctx completions bashShell completions