Your First Graph
Once CodeGraph is installed, building and exploring a graph takes three commands.
Index a project
Section titled “Index a project”cd your-projectcodegraph init -i # initialize + index in one stepinit creates the .codegraph/ directory; -i (or --index) immediately builds the full index. For an existing project you can re-index any time:
codegraph index # full indexcodegraph sync # incremental update of changed filesCheck it worked
Section titled “Check it worked”codegraph statusThis reports the node/edge/file counts, the active SQLite backend, and the journal mode — a quick health check that the index is ready.
Run a query
Section titled “Run a query”codegraph query UserService # find symbols by namecodegraph callers handleRequest # what calls a functioncodegraph callees handleRequest # what a function callscodegraph impact AuthMiddleware # what a change would affectcodegraph context "fix the login flow" # build task-focused contextEach accepts --json for machine-readable output. See the full CLI reference.
Hand it to your agent
Section titled “Hand it to your agent”With a .codegraph/ directory present and an agent configured (see Installation), your agent uses the MCP tools automatically — no extra step.