Code graph
The environment every thread runs in has CodeGraph installed: a local index of the Kotlin, Swift and TypeScript code (symbols, calls, who depends on what). It answers "how does X work" or "what breaks if I change Y" in one call instead of many greps and file reads.
Use it
- Main thread: call the
codegraph_exploreMCP tool with a question or a symbol or file name. It returns the relevant source, the call paths and the blast radius (callers and tests). - Subagents, or if the MCP tool is missing: run
codegraph explore "<question>"orcodegraph node <symbol|file>in Bash. If the repo has no index yet, runcodegraph initonce (about 6 s here). - Use it to find code and see impact before a change. Still read the files you edit, and still follow
CONTEXT.mdfor naming. The graph knows code, not decisions: ADRs and docs stay the source of truth. - Never commit
.codegraph/; it ignores itself.
Where it is set up
- Install and index: the environment's setup script installs
codegraphand runscodegraph initin the repo folder, so every new thread starts with an index. - MCP server: the environment's setup script registers it at user level with
claude mcp add --scope user codegraph -- codegraph serve --mcp. That gives the main thread thecodegraph_exploretool and keeps the index in sync as files change.claude mcp listshould showcodegraphas connected. If the tool is missing in a thread, say so and use the CLI. - Why not a repo
.mcp.json: a project-scoped server stays "Pending approval" until someone approves it, and a cloud thread cannot answer that prompt, even withenabledMcpjsonServersset. A user-level server needs no approval. - Copilot cloud agent:
.github/workflows/copilot-setup-steps.ymlinstallscodegraphand runscodegraph init. It has no MCP server, so it uses the CLI. - To change the version or the install, edit the environment, and the version in
copilot-setup-steps.yml.