Skip to content

CodeGraph

Pre-indexes your codebase into a local graph so AI coding agents find code with fewer tokens.

Stars
76.2k
Forks
5.1k
Licence
MIT
Language
TypeScript
Last update
4 days ago
Type
Dev tool

What it is

CodeGraph builds a structured map of a software project's code, including functions, classes and how files reference each other, and keeps it updated as files change. It runs entirely on your machine and connects to AI coding agents such as Claude Code, Cursor, Codex and Copilot through MCP, so the agent can look up code relationships instead of reading many files. The README says this reduces token use and tool calls.

  • Connect an agent to a project so it can answer where a function is defined or used
  • Keep an index in sync automatically while an agent edits code
  • Run codegraph init in each project to build its local .codegraph/ index
  • Remove agent configurations later with codegraph uninstall

Great for

  • Developers who use AI coding agents on medium or large existing codebases
  • Teams that want code indexing to stay on local machines
  • People working in mixed-language projects covered by the supported language list
  • Users of several agents who want one shared code index

Not ideal for

  • Projects in languages not on the supported list, since coverage is limited to what the README names
  • People who want a hosted service, because the README says the hosted platform is still a waitlist beta
  • Small scripts where a full code graph adds little value
Step-by-step guide: how to use CodeGraphInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    See the README

    Install CLI on macOS or Linux

    curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh

    Install CLI on Windows (PowerShell)

    irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex

    Connect installed agents

    codegraph install

    Index a project

    cd your-project && codegraph init
  2. 2

    Run it

    • Install the CLI with the command for your OS
    • Open a new terminal and run codegraph install to connect your agents
    • Change into your project folder and run codegraph init
    • Ask your agent a question about the code; auto-sync keeps the index current
  3. 3

    Get the most out of it

    • Use codegraph upgrade --check to see whether a newer version is available
    • Use --target with codegraph uninstall to remove CodeGraph from specific agents only
    • Run codegraph uninit per project to delete its .codegraph/ index when no longer needed

Downloads

Strengths

  • Runs locally, and the README states it is 100% local
  • Auto-syncs the index on file changes, so there is no manual re-indexing
  • Supports many agents through one installer

Trade-offs

  • Claims of fewer tokens and tool calls are the project's own and are not independently verified here
  • The hosted CodeGraph platform is described as coming and requires a waitlist
  • Setup touches agent configuration files, so users should review changes before running it

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.