Skip to content

Repository files navigation

CodeGraph

Deterministic, evidence-bearing repository intelligence that keeps uncertainty visible.

Release Go License Local first

CodeGraph turns a source checkout into a portable semantic graph whose nodes, edges, unknowns, evidence anchors, source revision, and dirty overlay can be inspected directly. The same query model is exposed through the CLI, MCP, loopback HTTP API, and browser UI.

flowchart LR
    A[Source checkout] --> B[Language frontends]
    B --> C[Canonical JSONL graph]
    C --> D[CLI]
    C --> E[MCP]
    C --> F[HTTP API]
    C --> G[Browser UI]
    C --> H[Verification]
    B -. ambiguity and gaps .-> C
Loading

Build a graph in 60 seconds

Windows users can download the current archive from GitHub Releases. The source path works on any supported Go/Rust toolchain:

git clone https://github.com/skrikx/codegraph.git
Set-Location codegraph
cargo build --release --manifest-path parser/Cargo.toml
go build -trimpath -o codegraph.exe ./cmd/codegraph
$env:CODEGRAPH_PARSER = (Resolve-Path parser/target/release/codegraph-parser.exe)
./codegraph.exe build --repo testdata/comparator-corpus --out .codegraph-demo --pdg
./codegraph.exe verify --graph .codegraph-demo --repo testdata/comparator-corpus
./codegraph.exe query --graph .codegraph-demo --kind callees --symbol app.entry.run

The build writes four canonical files: manifest.json, nodes.jsonl, edges.jsonl, and diagnostics.jsonl. These are the product truth. Indexes and views are disposable.

What is implemented

Surface State What you get
Repository graph Implemented and tested Files, modules, owned callables, types, calls, imports, communities, processes, routes, tools
Go and Python Implemented and tested Native Go type analysis and a dedicated Python AST frontend
JavaScript, TypeScript, Java, Rust, C, C++ Implemented and tested Isolated Tree-sitter parser protocol; language-specific completeness is recorded
Query plane Implemented and tested 36 registered query kinds through CLI, MCP, HTTP, and browser UI
Multi-repository graph Implemented and tested Checked registry, repository groups, exact cross-repository contracts
JS/TS PDG and dataflow Implemented with limits Opt-in control flow, control dependence, def/use, reaching definitions, bounded call summaries
Corpus graph Implemented and tested Deterministic JSONL ingestion, explicit mappings, lanes, checkpoints, semantic navigation
Machine graph Implemented and tested Checkpointed filesystem topology, retained access failures, optional bounded hashing, local service
Runtime truth Not inferred from source Portable verified reality bundles may enrich a graph; provider acquisition is not bundled

CodeGraph does not turn unresolved dynamic behavior into exact edges. Dynamic dispatch, reflection, generated code, macro/conditional compilation, heap aliasing, and live runtime effects remain explicit lower bounds where static proof is insufficient.

Query the graph

# Find symbols
./codegraph.exe query --graph .codegraph-demo --kind search --symbol normalize

# Walk calls from an owned callable
./codegraph.exe query --graph .codegraph-demo --kind callees --symbol app.entry.run --depth 3

# Inspect evidence and all adjacent relations
./codegraph.exe query --graph .codegraph-demo --kind proof --symbol app.entry.run

# Inspect unresolved, denied, unsupported, quarantined, and unverified boundaries
./codegraph.exe query --graph .codegraph-demo --kind gaps

Every result separates exact, ambiguous, unresolved, and inferred payloads and carries lower_bound and truncated flags.

One graph, four interfaces

# Browser and JSON API at http://127.0.0.1:7777
./codegraph.exe serve --graph .codegraph-demo

# Line-delimited JSON-RPC MCP over stdio
./codegraph.exe mcp --graph .codegraph-demo

HTTP refuses a non-loopback bind unless --token is supplied. See the HTTP guide, MCP guide, and security model.

Beyond one repository

Documentation

Start with Getting started, then use the documentation map. The most useful references are:

Project status

The released Windows archive is revision-bound and includes both executables, an SBOM, a release manifest, and documentation. A successful build is not a seal. Read release evidence and the release-specific asset hashes before relying on a candidate.

CodeGraph is a clean-room implementation. Comparison products were used as public behavior references, never as a source migration. See clean-room provenance.

About

Local-first, evidence-bearing repository intelligence and machine graph engine

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages