Skip to content

CTX

CTX - Context Runtime Engine for Coding Agents

Install: npm i -g @alegau/ctx-bin

Works with OpenCode · 145 GitHub stars

Install

$npm i -g @alegau/ctx-bin

Install command taken from the project's README or registry entry. Always review code before running it.

CTX

The context layer for AI coding agents

Reduce token waste in OpenCode and AI coding workflows with graph memory, compact task packs, read-cache compression, command pruning, and a live right-sidebar dashboard.

OpenCode-first runtime · Local MCP tools · Read cache + delta-aware indexing · Single Rust binary

Install · OpenCode Usage · Dashboard · Benchmarks · Docs · Security

CTX is a local context runtime for OpenCode and AI coding agents. It keeps repository knowledge, reusable rules, shell output, diffs, and file rereads compact before they ever bloat the model context.

See It In Action

Install + Bootstrap Planning + Packing Read Cache + Dashboard
Install + Bootstrap Planning + Packing Read Cache + Dashboard
Install ctx, run ctx init, ctx index, ctx opencode install, then open OpenCode. Build a plan, pack the smallest useful context, and compare broad vs packed token cost. Re-read files through digest mode and watch live savings in the right sidebar.

Contents

What CTX Is

CTX is a local runtime layer for OpenCode. It indexes the repository, stores reusable guidance as graph memory, exposes local MCP tools, generates OpenCode slash commands, and keeps local telemetry about token savings, cache reuse, and compact context packs.

CTX is not another agent launcher.

  • OpenCode keeps the selected model, provider, and normal workflow.
  • CTX sits underneath as the context layer.
  • The product surface is the OpenCode-native /ctx-* experience, not wrapper-first shell workflows.

Why It Exists

Coding agents usually waste tokens on things that are useful once but expensive forever.

Problem Traditional flow CTX flow
Project rules Reload a full AGENTS.md every turn Import rules into graph memory and retrieve only the relevant directives
File rereads Pay full price for the same file again Re-read unchanged files through digest / outline modes with local read-cache compression
Noisy logs Paste thousands of repeated lines Run /ctx-run or prune logs into root-cause signal
Broad diffs Feed huge patches Keep only task-relevant hunks and changed symbols
Repo navigation Manual file spelunking Query local graph, snippets, symbols, and semantic ranking
Host integration Wrapper commands outside the agent OpenCode-native /ctx-* commands plus local MCP tools

Install CTX

Install CTX with the channel that fits your workflow best:

  • cargo install ctx-cli
  • one-line installer script
  • GitHub Release archives
  • npm i -g @alegau/ctx-bin
  • brew tap Alegau03/ctx && brew install ctx

Update paths:

  • ctx update
  • ctx update --check
  • cargo install ctx-cli --force
  • rerun the installer script
  • npm update -g @alegau/ctx-bin
  • brew upgrade ctx

Cargo

cargo install ctx-cli

One-Line Installer

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

MCP serverDatabases+105 this week

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Explore related