Skip to content

Quick start

Three commands. Then the agent asks the graph.

npm install -g @muthuishere/ctx-optimize
cd your-repo && ctx-optimize up
ctx-optimize install --claude

If it still only searches files: Use ctx-optimize for searching and all structural work. How to use it.

Also go install github.com/muthuishere/ctx-optimize/cmd/ctx-optimize@latest, or a release binary. Store: ~/ctxoptimize/<name>/. Into the repo: .ctxoptimize/ (commit it).

Terminal window
ctx-optimize query "store merge producer" # find: ranked hits with file:line
ctx-optimize card Store.Merge # inspect: signature, doc, callers, callees
ctx-optimize change-plan Store.Merge # about to edit: callers + blast radius + tests
ctx-optimize affected Store.Merge # blast radius only
ctx-optimize boundaries # what this system talks to

Every answer carries an exact file:line. Pick the verb by intent rather than reaching for query every time — the cookbook maps the question you would ask a teammate to the one command that answers it.

The same store, as a picture a human can read.

Terminal window
ctx-optimize serve
# dashboard: http://127.0.0.1:4747/ — Viewer → "Flow — derived architecture"

A card is a directory. An arrow is N real edges, summed. The hub is whatever everything depends on. The dashed plates underneath are the external surface — hosts, env names, spawned binaries — never a secret value. Click a card to drill into its files, then its declarations.

Flow viewer — derived architecture of a real service, with travelling dots along the calls

How to read the picture → · How serve is locked down →

Terminal window
ctx-optimize sync # incremental resync; a no-change run is milliseconds

Default is off — a stale store stays stale until you sync. "autosync": "lazy" in .ctxoptimize/config.json is opt-in (first stale read answers now, a child refreshes for the next). There is no MCP server and no watcher. The agent may still grep; we do not block it. If it ignores the store, say this.