Skip to content

CodeGraphWho calls this, and what does changing it reach

CodeGraph parses a repository with tree-sitter into a local index of symbols, calls and imports, and answers structural questions from it, on the command line, for coding agents over MCP, and in a browser viewer. There is no model inside, so the same repository gives the same answer on every machine.

Runs on
Linux, macOS and Windows, on x86_64 and ARM64. One executable with SQLite built in.
Your code
The index stays in the project's .codegraph directory. Indexing and queries never go online.
The CodeGraph viewer showing the method IndexPaths::resolve, with its callers on the left, its source in the middle and the functions it calls on the right.The CodeGraph viewer showing the method IndexPaths::resolve, with its callers on the left, its source in the middle and the functions it calls on the right.

What CodeGraph does

The browser viewer is a preview and is switched off unless you turn it on; everything else is part of the regular command set.

Ask

  • Ask a question or name a few symbols; get their source grouped by file, what depends on them, and the calls between them.

  • A symbol's source with what it calls and what calls it, or a file with line numbers and the files that depend on it.

  • One step either way, or everything a change reaches through callers of callers.

  • From a list of changed files, the files that depend on them and the tests among them.

Connect

  • Read-only tools over standard input and output, written into each installed agent's config by one command.

  • MCP over HTTPAvailable

    The same tools over streamable HTTP on the local machine, for editors and remote development.

  • Agent skillAvailable

    Instructions that tell an agent which tool to use when, installed into each agent's skill directory.

Stay current

  • One background process per project, shared by every client, re-indexes the files you change.

  • Re-reads only what changed and ends up identical to a full rebuild.

See

  • Symbols, files, call paths, a module map, type hierarchies and unreached code, in light and dark.

Languages

  • TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, C#, PHP, Ruby, Swift, Kotlin and more.

  • Vue, Svelte, Astro, Razor and Liquid files, and MyBatis mapper XML.

  • Scenes, resources, scripts, autoloads and signal handlers, with a resource audit.

From install to the first answer

  1. Install

    curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.sh | sh

    Or the PowerShell script on Windows, or an archive from the releases page.

  2. Index a project

    codegraph init .

    Builds the index in the project's .codegraph directory. Later updates read only what changed.

  3. Ask a question

    codegraph explore "how does checkout compute the total" -p .

    Returns the relevant source, what depends on it and the calls between it.

  4. Connect your agent

    codegraph install --yes

    Adds the MCP server to the config of every agent it finds.

For coding agents ​

An agent with CodeGraph asks one structural question instead of searching and reading files one at a time, and gets back the relevant source together with the calls between it. Answers come from the parsed code, so they are the same on every run.

codegraph install --yes writes the MCP server into the config of Claude Code, Cursor, Codex CLI, Kiro, Zed, VS Code and the other agents it supports.

Connect a coding agent · MCP reference

QuestionCommand lineMCP tool
How does this area work?codegraph explorecodegraph_explore
Show me this symbol or filecodegraph nodecodegraph_node
Where is it defined?codegraph searchcodegraph_search
Who calls it?codegraph callerscodegraph_callers
What does changing it reach?codegraph impactcodegraph_impact

Both sides run the same engine, so an agent and you get the same answer. Every tool is read-only.

For you, in the browser ​

The viewer reads the same index: a symbol with its callers and callees, the call path from one function to another, the repository as a map of modules, the hierarchy of a type, and the code nothing reaches. It runs on your computer and only reads.

The browser viewer

The viewer's Flow view from cmd_explore to explore_file_header, one card per call and a table of every hop with its confidence.The viewer's Flow view from cmd_explore to explore_file_header, one card per call and a table of every hop with its confidence.

Many languages, at an honest depth ​

Most languages get full symbol extraction. Components and templates get their embedded scripts and markup, and a few formats are tracked at file level. The table says which is which, rather than one number for all of them.

Supported languages · Godot

DepthWhat is extractedLanguages
Full symbolsFunctions, classes, methods, imports, calls and referencesTypeScript, TSX, JavaScript, JSX, ArkTS, Python, Go, Rust, Java, C, C++, C#, PHP, Ruby, Swift, Kotlin, Dart, Scala, Lua, Luau, Objective-C, R, Solidity, Nix, Terraform, Erlang, GDScript, Pascal, CFML
EmbeddedThe scripts and template markup inside a host fileVue, Svelte, Astro, Razor, Liquid, MyBatis XML
File levelFiles and the references between themYAML, Twig, Properties, and Godot scene, resource and project files

A file in a language outside this table is not in the graph. Extensions can be mapped onto these languages in .codegraph/codegraph.json.

Platforms

Every release has an archive for each platform, a SHA256SUMS file and a build attestation per archive.

PlatformTargetArchive
Linux x86_64Availablex86_64-unknown-linux-musl.tar.gz
Linux ARM64Availableaarch64-unknown-linux-musl.tar.gz
macOS IntelAvailablex86_64-apple-darwin.tar.gz
macOS Apple SiliconAvailableaarch64-apple-darwin.tar.gz
Windows x86_64Availablex86_64-pc-windows-msvc.zip
Windows ARM64Availableaarch64-pc-windows-msvc.zip

The Linux builds are statically linked and need no system library. Building from source needs a Rust toolchain and a C compiler.

What stays on your machine

CodeGraph depends on no hosted service.

Indexing and queries

Goes onlineNothing

The index is a SQLite database inside the project. Parsing, resolution and every query run locally.

Agents, editors and the viewer

Goes onlineNothing

The MCP server talks to the program that started it; the HTTP server and the viewer listen on the local machine.

Install and updates

Goes onlineDownloads from GitHub

The install scripts and codegraph self-update fetch releases from GitHub Releases.

Install ​

sh
curl -fsSL https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.sh | sh
powershell
irm https://raw.githubusercontent.com/sunerpy/codegraph-rust/main/scripts/install.ps1 | iex
sh
cargo install --locked --git https://github.com/sunerpy/codegraph-rust codegraph-rs

The scripts check every archive against the release's SHA256SUMS before installing it. The install guide covers pinning a version, updating and removing CodeGraph.

What it does not do

  • It runs no model, no embeddings and no vector search; it answers from the parsed structure only.
  • It does not judge code. Whether it is correct stays with your compiler, linter and tests.
  • It does not see run time. Reflection, runtime callbacks and calls built from strings leave no edge.
  • It does not guess at languages it cannot parse.

Community and feedback ​

Bug reports and feature requests go to GitHub Issues. Scan the code with WeChat to follow the Official Account 六月水蓝. CodeGraph is MIT-licensed.

QR code of the WeChat Official Account 六月水蓝
Official Account 六月水蓝

CodeGraph is released under the MIT License and is one of the FirLab projects. Content from codegraph-rust@79eae25.