ctx smartOne model. Grounded input, governed output.
Precise retrieval and real code intelligence, from one fast local binary.
Right context, fewer tokens
ctx smart ranks files by meaning and call-graph relevance, then trims them to a token budget. Your agent gets the code that matters, not the whole repo.
Know what breaks first
Impact analysis answers "what depends on this?" before an edit lands — so agents check the blast radius instead of missing the caller three hops away.
Agent-native (MCP + JSON)
ctx serve --mcp exposes search, impact, and smart context as tools to Claude Desktop and other agents. Every command also speaks --output json.
Structural + semantic
Not just grep and not just embeddings. ctx combines tree-sitter call graphs with local vector search — it finds code by meaning and follows the relationships.
Local, private, offline
Written in Rust with local embeddings and a single portable SQLite file. No servers, no API keys required — your source never leaves your machine.
Multi-language, fast
Rust, TypeScript, JavaScript, JSX/TSX, Python, Go, Solidity, and YAML. Indexes thousands of files in seconds and only reindexes what changed.
Ground and govern every change
One world model, two jobs: feed the model the right context going in, and guardrail what it changes coming out.
# Build the world model once
ctx index
# Task-scoped, token-budgeted context
ctx smart "add rate limiting" --max-tokens 8000
# Or just the git changes, with call-graph context
ctx diff --summary# Enforce your architecture rules on the change
ctx check --against origin/main
# One gate for the whole change (exit 1 = not done)
ctx score --fail-on "check_violations>0,new_duplication>0"
# Auto-gate every agent edit via Claude Code hooks
ctx harness init --target claude