Skip to content

Latest commit

 

History

History
55 lines (43 loc) · 3.26 KB

README.md

File metadata and controls

55 lines (43 loc) · 3.26 KB

code-graph guide

code-graph indexes a codebase on your machine and answers the questions a change needs: where is the code for this request, what calls it, which tests reach it, and what did my change touch. It answers from a local SQLite file without calling a model, so your agent reads a few hundred lines it can verify instead of opening files one by one.

Start here

If you want to… Read
Install it and ask a first question Getting started
Understand how the answers are built and how far to trust them Concepts
Look up a command or an MCP tool CLI reference · MCP reference

Guides by task

Task Guide Main commands
Find where to change for a request, an issue or a stack trace Find the code locate, search, find
Know what breaks and which tests to run before you change Impact and tests impact, verify, callers
Check what a change actually touched Review a change review, check
Give the same answers to Codex, Claude Code or any MCP client Agents and MCP skill, mcp
Browse a project visually Dashboard explore
Start from Payment or another functional purpose, then open the code and tests Two maps flows, prepare, verify
Hand a change to one model and have the other review it Change with an agent change
Share an offline picture of the call graph Export export
Work on large repositories and keep the index fresh Large projects index, .cgignore, stats

Reference

  • CLI reference: every command and option, generated from the code.
  • MCP reference: every tool and parameter, generated from the code.
  • Formats: the JSON answers of locate, search, impact and verify.
  • Languages: what is resolved in each language, and where the analysis abstains.
  • Benchmarks: measured indexing speed, retrieval and agent pilots, with their limits.
  • FAQ and Troubleshooting.

When it helps, and when it does not

code-graph pays its way when the code you need is not in a file you already have open: a shared helper with many callers, a request worded differently from the code, a project too large to read. On a few small files, reading them is as cheap and the graph adds nothing; the benchmarks show this too.

It is a static analysis. A call that is only decided at run time (dynamic dispatch, reflection, dependency injection, routes registered by string) can be missing from the graph, and every answer says how a call was resolved. Treat the answers as a fast, verifiable guide to the code, and let the tests decide.

The example project

Every example in this guide runs on example/shop, a small order service with tests, and shows real output: tools/docs_examples.py re-runs the commands and a test fails when a page no longer matches what the code prints.