Skip to content

Indexing a Project

Terminal window
cd your-project
codegraph init -i # initialize + full index

init creates .codegraph/; -i/--index builds the index immediately. To initialize without indexing, drop the flag and run codegraph index later.

Terminal window
codegraph index # full index of the whole project
codegraph index --force # re-index from scratch
codegraph sync # incremental — only changed files

sync is fast because it only reparses what changed. Use it after a branch switch or a batch of edits.

When the MCP server is running, CodeGraph watches your project with native OS file events and syncs in the background — debounced, and filtered to source files only. You don’t need to run sync by hand during an agent session.

Terminal window
codegraph status

Reports node/edge/file counts, the active SQLite backend, and the journal mode.

Every file whose extension maps to a supported language, minus anything your .gitignore excludes and files over 1 MB. See Configuration.