
CTX
by Alegau03·★ 122·Score 47
CTX is a context runtime engine that optimizes AI coding workflows by reducing token waste through graph memory, compact task packs, and caching.
Overview
CTX is a Rust-based local runtime layer that serves as the context engine for OpenCode and AI coding agents. It indexes repositories, stores reusable guidance as graph memory, exposes local MCP tools, and maintains telemetry about token savings. CTX addresses token waste by implementing strategies like graph memory for reusable rules, read-cache compression for file rereads, command pruning for logs, and compact context packs. Unlike agent launchers, CTX integrates directly into the OpenCode workflow as a context layer.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose CTX if you're using OpenCode and need significant token reduction through intelligent context management, especially with complex rule sets or repeated file reads.
When NOT to choose this
Don't choose CTX if you're not using OpenCode, or if you prefer traditional markdown-based instruction files over graph-based memory systems.
Tools this server exposes
12 tools extracted from the READMEqueryQuery repository knowledge with hybrid graph, snippets, FTS, symbols, and semantic ranking
read_fileRead files with compressed modes: full, outline, or digest
packBuild compact task packs with graph, memory, failure, diff, and attachment signals
planCreate implementation plans by combining retrieval, graph, memory, and pack signals
run_commandExecute shell commands with root cause extraction and log storage
learnStore reusable project lessons in graph memory
toolbook_importImport toolbooks into CTX for large CLI manuals
toolbook_searchSearch imported toolbooks for specific information
toolbook_packPack relevant toolbook sections for specific tasks
prune_logsPrune logs and shell output to extract root cause signals
get_statsRetrieve token savings and performance metrics
dashboardDisplay live CTX dashboard with local runtime metrics
Note: Tool names inferred from slash commands documented in the OpenCode usage section. The documentation mentions MCP functionality but doesn't explicitly list the MCP tool names or signatures.
Comparable tools
Installation
Install CTX using one of these methods:
# Via Cargo
cargo install ctx-cli
# One-line installer
curl -fsSL https://raw.githubusercontent.com/Alegau03/CTX/main/scripts/install.sh | sh
# Via npm
npm i -g @alegau/ctx-bin
# Via Homebrew
brew tap Alegau03/ctx && brew install ctxTo integrate with OpenCode:
cd /path/to/your/project
ctx init
ctx index
ctx opencode install
opencodeFor Claude Desktop integration, add to claude_desktop_config.json:
{
"mcpServers": {
"ctx": {
"command": "ctx",
"args": ["mcp"]
}
}
}FAQ
- What makes CTX different from other AI coding tools?
- CTX is not another agent launcher but a context runtime layer that optimizes how information is passed to AI models through compression, caching, and graph memory, reducing token waste while preserving the original AI model and workflow.
- How does CTX reduce token usage in AI coding workflows?
- CTX implements several strategies including graph memory for reusable rules, read-cache compression for file rereads, command pruning for logs, delta-aware indexing, and compact context packs that contain only task-relevant information.
Compare CTX with
Last updated · Auto-generated from public README + GitHub signals.