# CodeGraph Code Index

The `ikanban-codegraph-setup` skill in your repository's `.iKanban/` folder sets up **CodeGraph**, a local code index. Your coding agents ask it through MCP, with one tool, `codegraph_explore`. One call returns the source of the relevant functions, who calls them, and what a change affects. Without it, an agent reads many files to learn the same thing. Sessions on your laptop runner use it while **Agent settings → Runners → Use CodeGraph** is on: the runner indexes each run's clone and gives the agent the server. Agent setup writes the skill with the full developer kit (Pro and Pro+), with `.iKanban/prompts/codegraph-setup.md` for agents without skills.

```
install 1.6.2 ─► telemetry off ─► index this repo ─► connect Claude, Copilot, Antigravity ─► prove one lookup
```

## The steps

| Step | What the agent does | You |
|---|---|---|
| Install | `npm i -g @colbymchenry/codegraph@1.6.2`. Any Node.js version works: CodeGraph brings its own runtime. | Say yes. |
| Telemetry | `codegraph telemetry off`, before any indexing. | — |
| Index | `codegraph init -y .` in the repository root. The index goes in `.codegraph/`. | Choose whether `.codegraph/` goes in your `.gitignore`. |
| Claude, Copilot, Codex | `codegraph install -y --target claude,copilot-cli,codex`. | Say yes: it changes your global agent settings. |
| Antigravity | `agy mcp add codegraph -- codegraph serve --mcp`. | Say yes. |
| Team rules | Adds a short "Code graph" block to `AGENTS.md` (and `CLAUDE.md` or `GEMINI.md`), and `.codegraph/` to `.gitignore`. | Say yes: the team shares these files. |
| Prove it | `codegraph callers <function>`, then one read-only session per agent. | Start the sessions. |

## Gates

| Gate | Value | Where you see it | Change it |
|---|---|---|---|
| Use CodeGraph in runner sessions | on | **Agent settings → Runners → Use CodeGraph**; the session page says whether the run got it | turn the switch off; applies from the next run |
| Runner version | the runner in an iKanban desktop app newer than 0.1.17; an older one ignores the switch | the desktop app's version | update the desktop app |
| CodeGraph on the laptop | needed for runner sessions; without it the run goes on without CodeGraph | the session page says *isn't installed on this laptop* | run the skill, or turn the switch off |
| The skill in your kit | full developer kit (Pro and Pro+) | **Agent settings → Set up** | upgrade the plan, or use the prompt |
| Version | 1.6.2, pinned | `codegraph --version` | a new kit pins a new version |
| Installs and agent settings | only after you say yes | the question in the session | — |
| Telemetry | off | `codegraph telemetry status` | `codegraph telemetry on` |
| The index | on this laptop only, never committed | `codegraph status .` | `codegraph uninit .` removes it |

## Keep it current

An agent's MCP server watches the repository and syncs on each save. When it starts, it catches up on edits made while it was off, including a `git pull`. After a pull with no agent open, run `codegraph sync .`. After a CodeGraph upgrade, rebuild with `codegraph index .` and restart your agent sessions.

## What it gets wrong

- **Same name, many functions:** `codegraph callers` lists each one. Narrow it with `-f <file>`.
- **A git worktree has no index of its own.** Run `codegraph init -y` in it first; without it, CodeGraph may answer from a parent folder's index and say "not found".
- **Calls through strings, macros or reflection** are invisible to any static index. Before you delete a function with no callers, confirm with one search.
