contextcode and documentationSearch, list symbols, inspect file outlines, and assemble bounded context. DocTree and scoped context support focused exploration.
Code Graph
Renso
Subscribe →
Code Graph has three surfaces: a terminal IDE that opens when you run code_graph with no arguments, a CLI you run directly, and an MCP server your coding agent calls on your behalf. The CLI and MCP server share one on-disk graph snapshot.
Use the script installer. It installs two commands on your PATH: code_graph (CLI) and code_graph-mcp (MCP server).
The Windows PowerShell installer verifies release signatures when minisign is on PATH; -NoVerify skips this signature check. SHA256 verification always applies. It downloads and verifies both Windows archives before replacing either command, so a rejected download leaves the installed pair unchanged.
macOS, Linux, WSL, and other POSIX shells:
curl -fsSL https://cg.renso.ai/install.sh | sh
Windows PowerShell:
iwr -useb https://cg.renso.ai/install.ps1 | iex
The Windows script installs to %LOCALAPPDATA%\code-graph\bin by default and adds that directory to the user PATH. Open a new terminal after install.
After install, sign in from the CLI. The command opens the browser activation flow and stores the local token used by code_graph and code_graph-mcp.
code_graph auth login
Then register the MCP server with supported coding clients.
code_graph-mcp --register
The installer fetches the latest release directly. Use code_graph update to refresh the local commands; on Windows it stops running code_graph and code_graph-mcp processes before replacing the executable files.
code_graph --version names the build as well as the release. The first line is the plain code_graph 1.6.3; a second build: line gives the variant (standalone or remote), the profile, the target, and the source commit, so two binaries with the same version number can be told apart.
When something is wrong with the install rather than with a repository — an agent answers from an older build, a second copy of the launcher shadows the one you installed, or a project's own config registers the server again beside yours — run:
code_graph doctor
doctor is read-only. It lists the code_graph and code_graph-mcp builds on PATH (the first of each name is the one that runs), how each MCP client is registered, which config files start the server and whether any client starts it twice, the running server processes and whether they predate the installed build, and this workspace's index — its age, its server, a rebuild lock left by a process that no longer exists, and (unless --quick) how many files differ from the index. Findings come first, most serious first, each with the fix beside it; --format json gives the same as data. It exits non-zero only when it finds a problem, and works without a licence.
Rebuilds, source writes, and the shared server use process-owned locks. A killed process releases ownership automatically, so the next operation can proceed without clearing files. mcp status reflects actual ownership: missing details are unknown, and leftover records do not make a crashed server appear to be running. The server resumes abandoned queued rebuilds when auto-rebuild is enabled; missing or damaged diagnostic records cannot displace a live owner. Existing workspaces retain their earlier locking behavior while older servers or writers remain active. Close those clients normally to complete the automatic upgrade, then use the same CodeGraph version for all clients. Unknown or foreign legacy owners are left untouched. Do not delete runtime lock files or directories while a workspace is in use.
From the root of any repository, build the graph:
code_graph rebuild
The first rebuild walks the whole tree. Subsequent rebuilds are incremental — only changed slices are re-indexed. Snapshots are written under .code_graph/snapshots/<id>/ with an atomic current.cg pointer.
To keep files out of rebuild input, add .codegraphignore (or its .cgignore shorthand) patterns using the same syntax as .gitignore, in any directory. Code Graph also combines .gitignore and honors all three in every directory of the workspace with the same precedence git applies — a nested file overrides a shallower one, sibling subtrees stay independent, and ! re-includes work at each level. It always excludes its own .code_graph/ storage directory, dependency caches, and secret-bearing files, and no nested rule can re-include them.
Changes to any ignore file — root or nested — and build-affecting profile settings invalidate reuse automatically, and the background updater picks up normal source changes without a local freshness command.
Register the MCP server with code_graph-mcp --register. Agents can query code and documentation, inspect dependencies, and request impact analysis. CodeGraph does not require a first tool call or impose a development process.
One graph holds everything Code Graph found in the repo:
#[test], pytest, JUnit, Go tests, JS framework hints.Each snapshot also stores search data built from the same graph, including exact identifiers, signatures, doc text, and local recall records. See search.
Code Graph indexes source in eleven languages and reads text from five document formats. Source files contribute symbols, imports, tests, and local relationships where confidence is high enough; documents contribute headings, prose, and cross-references to DocTree and search data. Files with an unrecognised extension are skipped, never guessed at.
| Language | Extensions | Coverage |
|---|---|---|
| Rust | .rs | Deep workspace graph: modules, types, traits, functions, imports, re-exports, calls, dispatch, and tests. |
| Python | .py .pyw | Modules, classes, functions, imports, common tests, and local relationships where clear. |
| TypeScript | .ts .tsx | Modules, exported symbols, imports, UI components, common tests, and local relationships where clear. |
| JavaScript | .js .jsx .mjs .cjs | Modules, exported symbols, imports/requires, UI components, common tests, and local relationships where clear. |
| HTML | .html .htm | Page elements, linked styles, scripts, images, forms, and media. |
| CSS | .css .scss | Selectors, style rules, imports, custom properties, and asset URLs. |
| Go | .go | Packages, functions, methods, types, tests, examples, imports, and local relationships where clear. |
| Java | .java | Packages, classes, interfaces, enums, methods, common tests, imports, and local relationships where clear. |
| C / C++ | .c .h .cc .cpp .cxx .hh .hpp .hxx | Namespaces, functions, methods, types, includes, and local relationships where clear. |
| Zig | .zig | Functions, public declarations, tests, imports, and local relationships where clear. |
| Clojure | .clj .cljs .cljc .bb | Namespaces, vars, functions, macros, records, protocols, tests, and imports. |
Documents carry no symbols, but their headings, prose, and links join the DocTree and search index.
| Format | Extensions | Coverage |
|---|---|---|
| Markdown | .md | Heading hierarchy, prose, code fences, and cross-references. |
| Jupyter notebook | .ipynb | Markdown/code cell sections and declared cell languages. |
.pdf | Best-effort text by page; scanned files may be file-level only. | |
| Word | .docx .doc | DOCX headings, paragraphs, and tables; legacy .doc may be file-level only. |
| Plain text | .txt .text .rst .adoc .log | Document sections and headings when detectable. |
HTML is read twice: as a source language for its markup and resource references, and as documentation for prose and headings when it stands in for a written page.
Run code_graph with no arguments and it opens a full IDE inside your terminal — keyboard- and mouse-driven, with no desktop app and no tmux/screen/zellij multiplexer required. Every explicit command (rebuild, search, blast-radius, --help, …) keeps its exact behavior; only the bare invocation opens the IDE.
code_graph # open the IDE for the current directory
code_graph --workspace . # open the IDE for a specific workspace
The IDE needs an interactive terminal. If output is piped or redirected, code_graph does not fall back to printing help — it writes a one-line diagnostic that Terminal IDE Mode requires an interactive terminal and exits with code 2, without emitting a single alternate-screen control sequence into your pipe.
code_graph > out.log # error: Terminal IDE Mode requires an interactive terminal
Windows, macOS, and Linux are first-class — including SSH, WSL, and containers. The terminal is restored on a normal quit, on Ctrl+C, on transient terminal I/O failures, and even on a panic.
The workspace is four mouse-resizable columns — threads, chat, code, and files — under a dock bar that toggles each one and opens a terminal or Settings. Drag any divider to resize; column visibility and sizes persist per workspace under .code_graph/ide/. The status surface stays deliberately small: an error/warning count and the current Git branch.
Enter to open a file.In Files, drag a file or folder row onto a folder to move it; hold Ctrl while dragging to copy. Dropping on a file row targets that file's parent folder, invalid drops are refused before any filesystem write, and name collisions open an Overwrite / Keep both / Cancel prompt. The same Move and Copy actions are available from the file context menu and from the focused Files column with m and c.
Every mouse action has a keyboard equivalent: Ctrl+1–Ctrl+4 toggle the four columns and Alt+← / Alt+→ resize the focused divider.
The code panel owns every tab. Files open as editor tabs; terminals run as tabs in the same panel — no separate pane, no multiplexer. The editor is a true editor core, not a wrapped text box:
When the code-panel tab row overflows, scroll over the tab row or use a horizontal trackpad wheel gesture to reveal more open tabs. Alt+Shift+← / Alt+Shift+→ switches to the previous or next tab from the keyboard. Visible tabs and close buttons remain clickable.
.code_graph/ide/.Ctrl+5.Settings opens as its own code-panel tab — theme (the Renso light palette, with a dark toggle), keymap reference, mouse mode, editor basics, and AI integrations — so configuration never sends you out of the workspace.
The chat composer auto-expands from one line to six (then scrolls), and carries inline pickers for provider, model, reasoning strength — low, medium, high, max — and pipeline. Enter sends, Shift+Enter inserts a newline, and Esc cancels a running agent.
The pipeline picker defaults to No pipeline. Skills and optional sequences are user-authored; fresh installations contain no built-in development stages or default pipeline.
On an established chat thread, provider, model, reasoning, persona, and pipeline pickers edit the next turn. The currently running turn keeps the profile it started with, and a changed CLI-backed profile starts a fresh session segment from the persisted transcript after the same fit/compaction gate used for normal dispatch.
Run one or more agent threads from the chat, each using the provider and model you pick in the composer. Because the IDE is Code Graph, every thread works against the same repo map it builds for the CLI and MCP server — search, dependencies, and blast radius — so an agent can see what a change would touch, just as you can from the command line.
For Claude Code CLI sessions, the IDE passes per-run settings that refuse detached run_in_background: true Bash/Agent tool calls. Headless runs wait in the foreground instead of leaving background work behind; use Esc or Stop to cancel the running agent.
When available for the selected CLI provider, Terminal IDE can keep one live provider process per thread instead of launching a fresh CLI for every message. Providers without live-session support continue in one-shot mode. The chat header shows a ● connected indicator once a CLI-backed thread is using a live stateful session (click it for details); one-shot providers show no indicator. The dock status bar carries concise notes for session start, fallback, setting changes, and transcript restore after a crash or idle timeout.
Stateful continuity is best-effort runtime state inside the IDE — it does not survive IDE restart. After a crash, idle timeout, or provider-setting change, the next turn restores from the persisted transcript (with the same compaction path one-shot mode uses), not from the previous live process. Idle sessions close after 30 minutes by default; override with CODE_GRAPH_IDE_CLI_SESSION_IDLE_SECS (seconds), and cap live sessions with CODE_GRAPH_IDE_CLI_SESSION_MAX (default 8). Grok one-shot turns stream until the CLI reports completion, exits with a failure, or you stop the run. Long silent tasks are not ended by an IDE inactivity deadline; streamed replies and any eventual failure remain visible in the chat transcript.
For Codex, Terminal IDE includes a live Codex connection path for CLIs with a compatible app-server command. When feature detection succeeds, Codex uses that live connection by default and can steer mid-turn follow-ups into the active turn; if app-server is unavailable or unhealthy, Codex falls back automatically to the existing one-shot path and queues mid-run follow-ups for the next turn. Detection runs in the background at IDE startup so sending a message never blocks the UI. Set CODE_GRAPH_IDE_CODEX_APP_SERVER_ROLLOUT=0 to force one-shot mode temporarily while investigating provider issues.
Skill execution uses the same contract on API and CLI providers. Direct API providers use structured skill tools, live CLI sessions run one skill per turn, one-shot CLIs run one process per skill, and prompt-only fallback is labeled as approximated. Settings → AI Providers shows the mode and delivery channel for each connected provider from the same capability snapshot the dispatcher uses.
Settings separates two kinds of integration and discovers both for you:
PATH when installed.Model lists come from the selected tool or provider automatically — there is no model catalog to hand-edit. Provider keys are written with the safest platform-local credential store available and live in your user config directory, never inside the project tree or .code_graph/ — so a key can't leak into a file your VCS or a coding agent would read.
Language-server diagnostics are runtime-auto: when you open a supported file, the IDE starts the matching local language server if the command is available on that machine (for example rust-analyzer). Set CODE_GRAPH_IDE_LSP=0 to disable this, or =1 to force the same runtime path.
The in-app Settings → Keyboard Commands list is the source of truth; these are the essentials. A keyboard equivalent exists for every mouse action.
| Action | Keys |
|---|---|
| Toggle Threads / Chat / Code / Files | Ctrl+1 … Ctrl+4 |
| Open the terminal | Ctrl+5 |
| Resize the focused column | Alt+← / Alt+→ |
| New file · close tab | Ctrl+N · Ctrl+W |
| Previous / next code-panel tab | Alt+Shift+← / Alt+Shift+→ |
| Save / save all | Ctrl+S / Ctrl+Shift+S |
| Undo / redo | Ctrl+Z / Ctrl+Y |
| Copy / paste / cut a selection | Ctrl+C / Ctrl+V / Ctrl+X |
| Move / copy the selected file-row item | m / c in Files |
| Select all | Ctrl+A |
| Find in file | Ctrl+F |
| Command palette | Ctrl+K |
| Open Settings | Ctrl+, |
| New chat thread | Ctrl+T |
| Cancel the running agent | Esc |
| Quit | Ctrl+Q |
On macOS the ⌘ (Command) key works in place of Ctrl for these shortcuts, so ⌘C / ⌘V / ⌘X / ⌘A copy, paste, cut, and select all — copy a chat-history or editor selection with the standard Mac shortcut (⌘C only ever copies; it never quits). The ⌘ shortcuts need a terminal that supports the keyboard-enhancement protocol — iTerm2, kitty, WezTerm, Alacritty, and Ghostty all do — which code_graph turns on automatically when the terminal advertises support.
code_graph-mcp speaks Model Context Protocol over JSON-RPC stdio. Code and documentation queries are read-only. Index maintenance and snapshot-pin management can write generated data.
On first run, code_graph-mcp --register adds the server to the global (user-level) launcher config of whichever clients it finds on the machine — so it works in every repo, not just one. The registered command uses --workspace ., so each launch scopes itself to that client process's current project directory. A launch directory that is not a project (an application's install folder, a drive root, your home directory) is not served: the server answers the protocol, writes nothing there, and tells the agent which folder it was started in. If the client reports its workspace folder over MCP, the session is handed to a server for that folder.
To remove it later, code_graph-mcp --unregister deletes the code_graph entry from those same clients, leaving every other server untouched. Add --dry-run to preview either command before it writes anything.
Detect installed clients and merge the standard code_graph server entry.
code_graph-mcp --register
Claude Code (the CLI agent) keeps user-scoped MCP servers in ~/.claude.json. Auto-register adds it through Claude Code's own CLI at user scope — global, across all your projects — when Claude Code is installed. To do it by hand:
claude mcp add --scope user --transport stdio cg -- code_graph-mcp --workspace .
Claude Desktop starts MCP servers outside any project and shares them with its Code tab, where an entry that runs in the launch directory would answer in place of your project's own server. So auto-register does not add an entry to claude_desktop_config.json (it only removes the --workspace . entry older versions wrote); Claude Code's registration covers the Code tab. To use code_graph in Desktop chat, add an entry that names your project by absolute path:
{
"mcpServers": {
"cg": {
"command": "code_graph-mcp",
"args": ["--workspace", "/absolute/path/to/your/project"],
"env": {}
}
}
}
Cursor reads MCP servers from ~/.cursor/mcp.json. Auto-register updates that file if the directory exists.
code_graph-mcp --register
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json under mcpServers. Auto-register merges this entry when Windsurf is installed.
{
"mcpServers": {
"cg": {
"command": "code_graph-mcp",
"args": ["--workspace", "."],
"env": {}
}
}
}
Cline stores MCP servers in cline_mcp_settings.json under the VS Code extension's globalStorage (…/globalStorage/saoudrizwan.claude-dev/settings/), with servers under mcpServers. Auto-register merges this entry when the Cline extension is present.
{
"mcpServers": {
"cg": {
"command": "code_graph-mcp",
"args": ["--workspace", "."],
"env": {}
}
}
}
Codex reads MCP servers from ~/.codex/config.toml as a [mcp_servers.cg] table — not a JSON file. Auto-register merges this table (keeping your other servers and settings) when ~/.codex exists.
[mcp_servers.cg]
command = "code_graph-mcp"
args = ["--workspace", "."]
Zed stores MCP servers in settings.json under context_servers (~/.config/zed/ on macOS and Linux, %APPDATA%\Zed\ on Windows). Auto-register merges this entry when Zed is installed.
{
"context_servers": {
"cg": {
"command": "code_graph-mcp",
"args": ["--workspace", "."],
"env": {}
}
}
}
VS Code reads mcp.json from your user profile (Code/User/mcp.json), with servers under servers and an explicit "type": "stdio". Auto-register writes it when VS Code is installed.
{
"servers": {
"cg": {
"type": "stdio",
"command": "code_graph-mcp",
"args": ["--workspace", "."],
"env": {}
}
}
}
Continue uses a YAML config at ~/.continue/config.yaml, where mcpServers is a list (each entry has a name). Auto-register appends the block to that file when it already exists, without touching your existing settings or comments — it won't create a config from scratch, so Continue must already be set up. If you already keep an mcpServers list (or only a legacy config.json), it's left untouched; add this entry yourself. MCP servers are only used in Continue's agent mode.
mcpServers:
- name: cg
type: stdio
command: code_graph-mcp
args: ["--workspace", "."]
Grok Build (xAI's terminal coding agent) reads MCP servers from ~/.grok/config.toml. Auto-register adds this table when that config file already exists — it won't create one from scratch. Grok Build also imports Claude Code's MCP config, so a Claude Code registration is picked up there too.
[mcp.servers.cg]
command = "code_graph-mcp"
args = ["--workspace", "."]
For any MCP client that accepts a server JSON block, add this entry and launch it from the project directory you want analyzed.
{
"mcpServers": {
"cg": {
"command": "code_graph-mcp",
"args": ["--workspace", "."],
"env": {}
}
}
}
The context and impact tools advertise readOnlyHint. Clients can use this annotation for their own permission settings. The other tools include operations that can write generated index data.
{
"permissions": {
"allow": [
"mcp__cg__context",
"mcp__cg__impact",
"mcp__cg__validate"]
}
}
Index diagnostics include repair operations, so validate does not claim to be entirely read-only. rebuild updates generated data and session manages snapshot pins. Client permission settings remain under your control.
For any MCP client, register the server with:
{
"mcpServers": {
"cg": {
"command": "code_graph-mcp",
"args": ["--workspace", "."],
"env": {}
}
}
}
The server resolves the analyzed workspace from --workspace <path>, falling back to the process working directory when the flag is omitted. The standard entry uses --workspace ., so the current project directory is explicit without hardcoding an absolute path. Launch from the intended project directory or pass an explicit workspace path; don't inject environment variables. Known CODE_GRAPH_* and RDB_* variables are scrubbed before each child code_graph call.
CodeGraph provides a code index and terminal IDE. MCP operations return code facts and diagnostics without prescribing a development process.
One server per workspace. code_graph-mcp runs one shared server per canonical workspace, shared by every agent on that project. The first launch wins a cooperative lease and serves every agent over a local socket; later launches for the same workspace bridge to it instead of starting another process. If that server process exits while a client is still attached, the attached process keeps the session and starts a replacement for the same workspace. An in-flight request can be lost; the next one runs on the replacement. Launches for different project directories get different main servers and endpoints. Each connection still gets its own isolated session; runtime scoped-context handles are cached for the workspace so follow-up traversal works after a reconnect or MCP process restart. The server stays up while at least one connection remains open, then exits after a short grace once every connection has closed and no rebuild is running or queued. A crashed server is reclaimed automatically by the next launch; launches that start together elect exactly one server and the rest attach to it, and a launch always finds a server that is accepting on the workspace's endpoint. code_graph --workspace . mcp status reports whether one is running.
contextcode and documentationSearch, list symbols, inspect file outlines, and assemble bounded context. DocTree and scoped context support focused exploration.
impactdependencies and changesInspect dependencies, reverse dependencies, paths, blast radius, snapshot differences, and affected-test recommendations.
validateindex diagnosticsInspect index health, consistency, freshness, coverage, and language support. Repair operations support a preview.
rebuildindex maintenanceExplicitly update the index or preview planned index work. Background updates normally keep it current.
sessionworkspace and snapshot statusReport the workspace and index freshness, or manage the session's snapshot pin.
Optional query prompts: impact and onboard. Tool descriptions explain capabilities and inputs. There is no required first call or built-in development lifecycle.
Structured query replies include their returned values as readable JSON in content[].text, so text-only clients can read crate names, freshness results, search hits, DocTree nodes, source context, and session status. The complete parsed result remains in structuredContent. Text is limited to 64 KiB with an explicit truncation notice; narrow the query or use follow-up traversal for more. Blast-radius replies retain their summary and drill guidance.
session supports current, repin, and release. Status identifies the workspace that answered and whether its index is current, refreshing, or behind. Snapshot pins protect a session's view during index maintenance.
Task routing, workflow recipes, plan and approval tracking, and policy-management commands are retired. Legacy calls return a retirement error. Existing records are preserved; index updates do not migrate, rewrite, or delete them. Archive legacy records before removing them manually.
After upgrading, close clients connected to an older shared MCP server and let it exit before reopening them. The default idle grace is five minutes. code_graph doctor reports servers older than the installed build. Existing sessions can continue until you close them.
Reconnect MCP clients after upgrading to refresh cached tool descriptions. User-authored repository instructions remain under your control.
The CLI builds the graph and is also a perfectly good way to query it directly. Run code_graph --help for the full flag list.
Build (or incrementally update) the snapshot. Pick a profile to tune rebuild speed, memory, and response budgets.
code_graph rebuild
code_graph rebuild --diagnostics
code_graph rebuild --quick
code_graph rebuild --memory-budget-mb 2048
code_graph rebuild --profile ci
code_graph rebuild --profile large-monorepo
| Profile | For |
|---|---|
default | Most repos. |
ci | Strictest validators, fail-on-warning. |
local-dev | Fast incremental rebuilds while iterating. |
docs-heavy | Repos with many documents (PRDs, ADRs, notebooks). |
large-monorepo | Huge repos: bounds rebuild memory, enables workspace-hygiene guidance, defers optional search data under pressure. |
mcp-low-token | Tighter response budgets for token-constrained agents. |
secure | Uses configured redaction patterns. |
Configure redaction patterns in code_graph.toml to protect source context and MCP responses. Source snippets and MCP response text are redacted before display limits are applied, and source line positions stay intact for patterns and replacements spanning multiple lines. Existing MCP connections use policy changes immediately, including for previously built search data. The secure profile supplies no automatic secret patterns; missing or malformed policies and invalid regular expressions do not prevent Code Graph from running.
| Flag | Effect |
|---|---|
--diagnostics | Print a bounded report after the rebuild: per-stage wall time and peak resident memory, the slowest stage, input census by category, artifact sizes, reuse outcomes, parser/slice/revision-cache counters, search data details including reused/computed record counts, carried-forward semantic records, bounded timing buckets, sharded payload counts and physical-write accounting when an internal sharded snapshot is used, and top cache-miss reasons. The source-free structured form is always written to rebuild-diagnostics.cg. |
--quick | Low-latency local mode: always publishes graph + DocTree, reuses search data when safe, and defers optional search data until a later rebuild. |
--memory-budget-mb N | Cap rebuild memory. Lowers the search-writer buffer and worker count and defers optional search data under pressure. Overrides CODE_GRAPH_REBUILD_MEMORY_MB and the profile default; a conservative system-memory default applies otherwise. |
code_graph rebuild-report prints that stored report for the active snapshot (--snapshot <id> for another, --format json for data), so you can see where the last rebuild's time and memory went without running a second one. While a rebuild runs it also prints a still running line to stderr every minute — elapsed time, the stages currently open, and the peak memory so far — so a long stage on a large repository is not mistaken for a hang; CODE_GRAPH_REBUILD_HEARTBEAT_SECS changes the interval and 0 turns it off.
Ignore files — root or nested — and build-affecting profile settings are part of rebuild input. When they change, Code Graph bypasses stale reuse automatically. Performance Pass 1 reuse and diagnostics are enabled by default; set CODE_GRAPH_PERF_PASS_1=0 to roll back the full pass, or CODE_GRAPH_PERF_PASS_1_PARSER=0, CODE_GRAPH_PERF_PASS_1_SLICES=0, or CODE_GRAPH_PERF_PASS_1_REVISION_CACHE=0 for a narrower opt-out. Performance Pass 2 extends rebuild diagnostics with dirty-set attribution, changed-key search and semantic counters, graph publishing sub-stage timing, dashboard refresh metadata, and memory attribution; set CODE_GRAPH_PERF_PASS_2=0 to roll back the full pass or disable individual sub-gates such as CODE_GRAPH_PERF_PASS_2_SEARCH_DELTA=0. A deferred dashboard is stamped freshness=stale; run a full rebuild or quality-dashboard --write before trusting floor verdicts. If another rebuild already holds the workspace lock, rebuild queues one follow-up rebuild and exits successfully; additional requests return success while that follow-up is already queued. Full-slice rebuild is an explicit maintenance override; agent freshness should come from background updates. Under --diagnostics or the large-monorepo profile, the rebuild also prints workspace-hygiene guidance — the top avoidable input categories (generated, vendored, fixtures, coverage, build output, large docs) and suggested .codegraphignore entries. Hygiene suggestions are local-only and never sent as telemetry.
When default-profile inputs are proven stable, the dashboard can be carried forward as mode=carried_forward freshness=current.
Search across code, docs, features, sections, and supported-language symbols. Results use the available search data and keep exact matches first-class. Additional candidates are not treated as source-of-truth evidence.
code_graph search "query planner" --intent implementation
code_graph search "feature tags" --intent feature --limit 20
code_graph search "open manifest" --kind Function --path crates/example
code_graph search "doc_tree" --feature-state incomplete --feature-phase phase-9
code_graph search "marker" --doc-has-code true --doc-code-language rust
Intents: general, implementation, tests, docs, feature, endpoint, config. Entity hits include bounded signatures when available. Empty results include suggestions for filters to relax, simpler identifier fragments, nearby IDs when a relaxed lookup finds candidates, and a DocTree search follow-up. Hits also include compact retrieved_by and exact_id_match fields. Add --explain to see match reasons, the active rebuild profile, and which search data contributed each hit.
Walk downstream from any entity or file, starting with a summary by default: severity, roll-ups, public surfaces, tests, bottlenecks, and capped sections. Use --detail full for the complete listing, or drill with --focus, --path-to, --tree, --depth, --page-size, --cursor, and --covered. JSON output is view-scoped: summary JSON contains rollups and cutoff guidance, focus JSON contains only the requested page, path JSON contains only the requested path, and --detail full --format json returns the full parsed blast-radius payload. Pair blast-radius with --explain when you need per-edge provenance and confidence. Use path --from <id> --to <id> for bounded forward call paths with relation kinds and available provenance. Reachability coverage uses tiered test attribution.
code_graph blast-radius StorageEngine
code_graph blast-radius StorageEngine --detail full --explain
code_graph blast-radius StorageEngine --focus kind:Function --page-size 25
code_graph blast-radius StorageEngine --tree structural --depth 2
code_graph blast-radius --file crates/example/src/lib.rs
code_graph blast-radius --file crates/app/src/routes.rs --line 55 --explain
code_graph blast-radius --file crates/app/src/routes.rs --range 55:80 --explain
code_graph blast-radius --worktree --detail summary
code_graph blast-radius --since origin/main --explain
code_graph path --from api::CreateUser --to db::insert_user --max-items 5
code_graph reachability StorageEngine --format json
Bounded LLM context for one entity, file, or query. Includes direct deps, reverse deps, affected crates and tests, endpoints, features, docs, and small source snippets. file-outline returns a line-sorted bounded summary of entities defined in one file.
code_graph context-pack --entity StorageEngine --max-items 12
code_graph context-pack --file crates/example/src/lib.rs
code_graph context-pack --query "schema migration" --intent feature
code_graph file-outline --file crates/example/src/lib.rs --max-items 20
Walk entities by kind, then trace forward or reverse dependencies. Add --with-provenance for bounded relation evidence with file/line snippets.
code_graph list --kind function --limit 20
code_graph list --kind cli --format json
code_graph deps StorageEngine
code_graph deps StorageEngine --with-provenance --limit 10
code_graph rdeps StorageEngine --with-provenance --limit 10
Accepted kinds include crate, module, file, trait, struct, enum, function, test, endpoint, config, cli, env, doc, section, feature, and schemafield.
Run before opening a PR. preflight rolls up impact across a set of changed files; affected-tests prints the test command that covers them, using tiered test attribution by default. Set CODE_GRAPH_BROAD_TEST_EDGES=1 only when comparing against legacy broad coverage. change-summary --format both returns review Markdown and the structured summary from one command execution.
Tests defined in a changed source or test file are included, including nested unit tests. Selection reasons distinguish file definitions from known dependency paths. Recommendations describe known coverage; an empty result does not establish safety. Use a broader package or workspace suite when needed. MCP impact keeps its runnable text default for affected_tests; format: "json" returns structured test commands and selection reasons.
code_graph preflight --files crates/a/src/lib.rs,crates/b/src/lib.rs
code_graph affected-tests --files crates/a/src/lib.rs
code_graph change-summary --worktree --format both
trust gives agents a compact ok/stale/inconsistent/drift verdict before they rely on other generated-data reads. Freshness guidance distinguishes changed files from missing evidence, while existing reads remain available.
File comparisons determine freshness; a commit-only change does not make unchanged search data stale. The report distinguishes current, behind, and unknown freshness, and includes stale-knowledge counts in its drift verdict. Missing or unreadable freshness evidence is advisory: existing context remains available, and the notice points to an evidence check instead of asking you to wait for a refresh that is not running.
code_graph trust --format json
code_graph missing-links --new --format json
code_graph feature-truth --new --format json
code_graph check-tags --new --format json
An absence-based report describes the indexed evidence; runtime behavior requires separate verification.
feature-truth reconciles claims with code and documentation evidence. An owning crate identifies responsibility and does not prove implementation; relevant code evidence is required. The report is clean only when no remaining high-severity findings or stale-knowledge claims exist. Finding filters do not clear the workspace-wide stale-knowledge count. Reports are nonblocking by default; --strict opts into a failing exit status for an unclean report.
code_graph partial-rebuild-plan describes planned index work without writing an update. This is index maintenance, independent of how you develop code.
Retired process records remain in .code_graph/registry.cg and any legacy .code_graph/registries/ directory. Copy these files to an archive before removing them manually. code_graph inspect <path> can decode supported artifacts. The previous CodeGraph version can also open an archived copy.
Optional @feature(group::name) annotations label related code and documentation. These are searchable code metadata, independent of the development process you choose.
// @feature(search::filters)
The CLI's features, feature-catalog, and check-tags commands provide read-only views. Legacy declarations remain readable; feature-lifecycle management is retired.
Every rebuild writes a new snapshot directory and atomically swaps the current.cg pointer. Concurrent rebuild requests coalesce into one queued follow-up rebuild and return success instead of racing. Large generated snapshot artifacts are stored as opaque payload bundles under generic d/<hex>/<digest>.cg paths when they exceed the sharding threshold, while logical artifact names continue to resolve through the manifest. You can list, diff, prune, or roll back without touching the build cache.
code_graph index-snapshot --format json
code_graph index-diff --from <old> --to <new> --format json
code_graph index-rollback --snapshot <snapshot-id>
code_graph index-prune --keep 5
index-prune reports stale session pin files it sweeps while evaluating retention; JSON output exposes the same list as stale_session_pins. Search data writes retry transient filesystem or index-writer failures with exponential backoff; use CODE_GRAPH_SEARCH_BUILD_RETRIES and CODE_GRAPH_SEARCH_BUILD_RETRY_BASE_MS to tune the retry policy.
Trend history is kept outside snapshot directories under .code_graph/trends/trends.log, so rollback never loses it. Legacy trends.jsonl is migrated on first rebuild.
CodeGraph supplies search, symbol context, dependencies, impact analysis, and affected-test recommendations. Choose the operations that fit your request. The index updates automatically as files change.
Use index diagnostics and explicit rebuilds when needed. Development-process tools and policy-management commands are retired. Existing records are preserved; archive the legacy records before removing them manually. User-authored skills, settings, and repository instructions remain yours.
Indexing, search, blast radius, and MCP serving all run locally against the on-disk snapshot. Source code never leaves the machine. The control plane only sees:
That's the full surface. No file contents, no symbol names, no commit messages.