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.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
來自發布者
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.
CTX - Context Runtime Engine for Coding Agents
| 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. |
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.
/ctx-* experience, not wrapper-first shell workflows.Coding agents usually waste tokens on things that are useful once but expensive forever.
Install CTX with the channel that fits your workflow best:
cargo install ctx-clinpm i -g @alegau/ctx-binbrew tap Alegau03/ctx && brew install ctxUpdate paths:
ctx updatectx update --checkcargo install ctx-cli --forcenpm update -g @alegau/ctx-binbrew upgrade ctxcargo install ctx-cli
curl -fsSL https://raw.githubusercontent.com/Alegau03/CTX/main/scripts/install.sh | sh
npm i -g @alegau/ctx-bin
brew tap Alegau03/ctx
brew install ctx
git clone https://github.com/Alegau03/CTX.git
cd CTX
cargo install --locked --path crates/ctx-cli
Verify:
ctx help
ctx doctor
ctx update --check
Native update command:
ctx update
How ctx update behaves:
cargo install ctx-cli --forcenpm update -g @alegau/ctx-binbrew upgrade ctxDownload the latest assets from GitHub Releases, then run:
shasum -a 256 -c SHA256SUMS
tar -xzf ctx-0.2.5-aarch64-apple-darwin.tar.gz
mkdir -p "$HOME/.local/bin"
install -m 0755 ctx-0.2.5-aarch64-apple-darwin/ctx "$HOME/.local/bin/ctx"
export PATH="$HOME/.local/bin:$PATH"
If you prefer a system-wide install:
sudo install -m 0755 ctx-0.2.5-aarch64-apple-darwin/ctx /usr/local/bin/ctx
For the full install matrix, release verification notes, native update behavior, and distribution details, see docs/install.md.
Once ctx is installed, enable it in any project:
cd /path/to/your/project
ctx init
ctx index
ctx opencode install
opencode
If you want the leanest possible OpenCode surface first:
ctx opencode install --profile core
Profile summary:
full (default): full CTX slash-command surface plus the live right-sidebar CTX Dashboardcore: lean daily workflow with /ctx, /ctx-doctor, /ctx-plan, /ctx-retrieve, /ctx-pack, /ctx-run, /ctx-prune-logs, /ctx-stats, and /ctx-gainInside OpenCode, start with:
/ctx
From there, the main workflow is:
/ctx-doctor
/ctx-memory-bootstrap
/ctx-plan <task>
/ctx-retrieve <query>
/ctx-read <file> [mode]
/ctx-pack <task>
/ctx-compare <task>
/ctx-run <shell command>
/ctx-gain
/ctx-dashboard
Toolbooks and reusable lessons are also first-class:
/ctx-toolbook-import <name> <file>
/ctx-toolbook-search <name> "<query>"
/ctx-toolbook-pack <name> "<task>"
/ctx-learn <key> "<body>"
For full usage, expected outputs, and CLI equivalents, see guide.md and docs/commands.md.
Graph Memory is CTX's structured replacement for repeatedly loading whole instruction markdown files. It keeps directives local, queryable, editable, and exportable when markdown compatibility is still needed.
Instead of this:
AGENTS.mdCTX lets you do this:
/ctx-memory-bootstrap/ctx-memory-search/ctx-plan and /ctx-pack/ctx-learnWhen CTX is installed with the default full profile, OpenCode gets a live CTX Dashboard in the right sidebar.
The sidebar is meant to be a lightweight control tower for the current repo, not another verbose chat response. It auto-refreshes local runtime metrics such as:
The right-sidebar view is intentionally compact. It focuses on the live metrics that matter most instead of repeating verbose activity logs or warning blocks that are already available in the main CTX outputs.
Use the core profile when you want the smallest possible slash-command surface and do not need the sidebar yet.
The committed demo benchmark compares a traditional markdown-rule flow against CTX graph memory on demo/fixtures/opencode-auth-lab.
Reproduce it with:
scripts/demo/opencode-auth-lab-benchmark.sh ./target/debug/ctx
Evidence files:
External validation is also committed in docs/external-benchmark-agentsmd.md, including a public-repo snapshot with:
72.62%markdown=1.00, graph=0.89markdown=0.50, graph=1.00markdown=0, graph=1, ties=0CTX is local-first by default:
local_only = trueremote_upload_enabled = false.ctx/graph.db, .ctx/packs/, .ctx/stats/, and .ctx/audit.log stay local.env, private keys, credentials, and secret files are blocked by defaultSee docs/security.md.
CTX - Context Runtime Engine for Coding Agents
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
CTX 透過 stdio 在本機執行。
上次檢查時間:2026-11-05。 CTX - Context Runtime Engine for Coding Agents