Optave codegraph CLI
A CLI that builds a function-level dependency graph for 34 languages and serves it to agents through a 34-tool MCP server.
- 99 ★ on the repository
- Last commit
Extended access
Why this level
- Reads the whole repository source and writes a `.codegraph/graph.db` database into the project.
- When an external LLM provider is connected, code fragments go to it.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/optave-codegraphDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Reads the whole repository source and writes a `.codegraph/graph.db` database into the project.
- When an external LLM provider is connected, code fragments go to it.
This is third-party code. Review the repository files before installing.
What it does
codegraph parses code with tree-sitter, stores a call and import graph in SQLite and updates it incrementally in a fraction of a second. The `codegraph mcp` command starts an MCP server, so an agent learns in one query who calls a function and what breaks when it changes. The graph holds symbol roles (entry, core, utility, adapter, dead, leaf), complexity metrics, co-change data from Git history and structural diffs between branches. Building and querying run locally, with no keys and no telemetry.
Who it is for. Teams with large codebases where Claude Code or Cursor edit functions without knowing every caller.
Good fit when
- An agent is about to change a function whose callers are spread over dozens of files.
- After a refactor you need to find dead exports and circular dependencies.
- Pull requests are gated with `codegraph check --staged` using blast-radius and complexity thresholds.
- A new developer finds out what calls handleAuth without reading the whole repository.
Not a fit when
- You need vulnerability scanning: the author deliberately left security analysis out of scope.
- The repository is small and grep with file reads is enough for the agent.
- The environment has no Node.js 22.12 or newer.
Example request
Use codegraph to show which functions break if I change parseConfig, and flag dead exports in src.Limitations
Needs Node.js 22.12 or newer. The graph lives in `.codegraph/graph.db` inside the project and needs `codegraph build` or `codegraph watch` after edits. Security analysis is out of scope. Semantic search on embeddings runs locally, but when you connect an external LLM provider the code goes wherever you send it. The MCP server serves one repository by default, and several are enabled separately. Pre-release archives from GitHub Releases install from a local file: installing by archive URL fails because of platform-specific dependencies.
How to disable. Remove the `codegraph mcp` entry from the MCP configuration and uninstall the global @optave/codegraph package with npm. Delete the `.codegraph` folder in the project by hand.
FAQ
How do I connect codegraph to Claude Code?
Build the graph with `codegraph build` and register `codegraph mcp` as an MCP server in the client configuration. MCP is optional: add `codegraph where`, `codegraph context` and `codegraph fn-impact` as the pre-edit routine in CLAUDE.md.
Does codegraph send code over the network?
No. Building and querying run locally with no keys, accounts or telemetry. An external LLM provider is optional, and only then does code go to it.
How many tools does the MCP server have?
Thirty-four. They cover symbol lookup, function context, blast radius, call chains, branch diffs and complexity metrics.
How do I use codegraph in CI?
The `codegraph check` command exits with code 1 when complexity, blast radius, cycle or architecture boundary thresholds are broken. The manifesto describes the rules, and a ready GitHub Actions workflow covers pull request diffs.
Which languages does codegraph support?
Thirty-four, including JavaScript and TypeScript, Python, Go, Rust, Java, C#, PHP, Ruby, C and C++, Kotlin, Swift and Scala. All of them go into one shared graph.
Discussion
No questions or reviews yet.
Related
CLI toolsCode dependency graph for VS Code, the CLI and MCP: imports, calls, cycles, dead code and change impact.
Local code graph for agents: an MCP server returns entry points, symbol links and change impact in one call
Structural questions about code instead of brute-forcing files: 38 languages, 42 tools, VS Code and JetBrains plugins, a CI mode
CodeGraph (Rust)
codegraph-rust
A Rust code graph for agents: four MCP tools show what an edit will touch, how the architecture fits together and where the fragile spots are
An MCP server that builds a code knowledge graph: semantic search, call graph, HTTP route tracing and change impact analysis.
Local code structure graph: builds a repository map with tree-sitter and serves the assistant only the context a change actually touches over MCP
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Authentication | Repository stars | Main difference |
|---|---|---|---|---|
| Optave codegraph (this card) | no | 99 | ||
| code-graph-rag | no | not required | 5,349 | builds a knowledge graph of a monorepo; Optave codegraph keeps a function-level call graph with CI checks |
| codebase-memory-mcp | no | not required | 48,531 | answers structural agent queries; Optave codegraph adds complexity metrics, architecture boundaries and branch diffs |
README in short
The graph holds functions, calls, file dependencies, symbol roles and complexity metrics. On top of it run 44 CLI commands, an MCP server and CI checks; the graph exports to DOT, Mermaid, GraphML and Neo4j CSV.