CodeGraph Architecture

CodeGraph Architecture An architecture diagram generated by Archify. Source Codebase · any supported language · Architecture component Source Codebase any supported language File Watcher · native FS events · Architecture component File Watcher native FS events Extraction · tree-sitter AST · CodeGraph engine — local-first, no server · 29 wasm grammars Extraction tree-sitter AST 29 wasm grammars SQLite Index · nodes · edges · files · CodeGraph engine — local-first, no server · WAL + FTS5 SQLite Index nodes · edges · files WAL + FTS5 Reference Resolver · imports · names · frameworks · CodeGraph engine — local-first, no server Reference Resolver imports · names · frameworks Graph Query · callers · callees · impact · CodeGraph engine — local-first, no server Graph Query callers · callees · impact Context Builder · markdown / JSON · CodeGraph engine — local-first, no server Context Builder markdown / JSON Browser Viewer · read-only JSON API · Architecture component Browser Viewer read-only JSON API CLI · init · index · query · Architecture component CLI init · index · query MCP Server · codegraph_explore · node · Architecture component MCP Server codegraph_explore · node AI Agents · Claude Code · Cursor · Codex · Architecture component AI Agents Claude Code · Cursor · Codex source files incremental sync parsed symbols & edges stored symbols resolved edges traversal results context payload markdown / JSON read-only JSON API MCP tool calls CodeGraph engine — local-first, no server Legend Frontend Backend Database External

Deterministic extraction

  • • Symbols and edges come from the AST, never LLM summaries
  • • 29 tree-sitter grammars, with heavy parsing off the main thread
  • • Re-indexing the same source produces the same graph

One local index

  • • SQLite with WAL and FTS5 under .codegraph/
  • • Node's built-in node:sqlite — no native build step
  • • Per project, and it never leaves the machine

Graph to answer

  • • Import, name, framework and dynamic-dispatch resolution
  • • Callers, callees, impact radius and named-symbol flow
  • • Three read-only surfaces: MCP server, CLI, browser viewer