Monorepo intelligence for humans and AI agents

supergraph

Your entire monorepo in one file.

supergraph analyzes your monorepo and generates a compact, structured text map of every module, every symbol, every cross-package edge, and every issue. One file an AI agent can read to understand your entire codebase. One file a human can grep to answer any structural question.

$ curl -fsSL https://raw.githubusercontent.com/bravenewxyz/supergraph/main/install.sh | bash
$ brew install bravenewxyz/supergraph

Installs the supergraph binary. The curl script also installs the /deep-audit command for Claude Code.


the output

365 modules. 852 edges.
One text file.

Running supergraph in your monorepo generates audit/supergraph.txt — a structured, compressed map of your entire module graph. Every package, every exported symbol, every dependency edge, every issue.

1
text file
~500
lines for a full monorepo
0
files the agent needs to read
audit/supergraph.txt — real output from a 21-package monorepo
GNOMEFORTRESS-V2 SUPERGRAPH | 2026-03-05
365m · 852ie · 209xe

# PACKAGES  (short=npm,modules)
agent=@gnomefortress/agent,7m  cli=@gnomefortress/cli,13m
core=@gnomefortress/core,14m  fortress=@gnomefortress/fortress,85m
graph=@gnomefortress/graph,37m  flow=@gnomefortress/flow,35m  ...

# MODULES
# path [exp(/total)]<-importers symbols | ext-deps

[fortress]
actors/orchestrator [68/93]<-2 OrchestratorActorContext,OrchestratorActorInput,actor,+63
    | @gnomefortress/constants,@gnomefortress/graph,xstate
events [119/120]<-16 AbortEvent,ActorErrorLog,AnomalyDetectedEvent,+111
    | @gnomefortress/graph,xstate
types [69/71]<-47 AnomalyDetectorState,Checkpoint,ComposeResult,+61
    | @gnomefortress/core,@gnomefortress/graph

[graph]
store/graph-store [2/4]<-9 SerializedGraph,GraphStore | graphology
schema/nodes [4]<-11 SymbolNode,SymbolKind,createSymbolNode,KIND_PRIORITY
schema/edges [3]<-10 SymbolEdge,EdgeKind,createSymbolEdge

# CROSS-PACKAGE DEPENDENCIES
fortress/actors/orchestrator -> constants/idx graph/idx graph-bridge/idx utils/idx xstate/idx
fortress/events -> graph/idx graph-bridge/idx xstate/idx
fortress/types -> graph/idx graph-bridge/idx core/idx
[exp/total]
Symbol counts
Every module shows exported vs total symbols, so you instantly see API surface vs internal complexity.
<-N
Importer count
How many modules import this one. High fan-in = critical shared infrastructure. Zero = potential dead code.
sym,sym,+N
Exported symbols
Functions, types, constants, classes — listed inline. Budget scales with importance: more importers = more symbols shown.
| ext
External dependencies
npm packages each module depends on, listed after the pipe. Configurable aliases compress long package names.
->
Cross-package edges
Every inter-package import is listed explicitly. The most important relationships in any monorepo, made first-class.
~500 lines
Fits in any context
A 365-module, 21-package monorepo compresses to ~500 lines. Dead modules are omitted. Paths are shortened. No noise.

deep-audit

10-phase code audit.
One slash command.

The install script adds /deep-audit as a Claude Code slash command. Point it at any package and it performs a systematic, multi-pass audit — finding bugs, dead code, overengineering, race conditions, and logical errors. All results written to disk as actionable plans.

Claude Code
/deep-audit packages/orchestrator/src
0
Generate artifacts
Runs supergraph to generate map.txt, deps.txt, imports.txt, complexity.txt, dead.txt, schema-match.txt, trace-boundaries.txt, logic-audit.txt.
1
Read the map
Reads all generated artifacts in full. Every subsequent phase depends on this complete context.
2
Structural audit
Dead exports, circular dependencies, complexity hotspots, type-safety escape hatches, oversized modules, dependency fan-out/fan-in.
3
Deep audit
Reads source files prioritized by risk. Checks for duplicates, overengineering, inconsistencies, dead code, unfinished features, bugs, error handling gaps.
4
Cross-cutting analysis
Architectural coherence, abstraction level consistency, single responsibility violations, structural impedance (pure adapters, data clumps, type overlaps).
5
Data flow trace
Schema-type mismatches, error path analysis, unsafe type assertions, JSON roundtrip losses, missing post-deserialization validation.
6
Logic analysis
Decision table gap detection, guard consistency, cross-representation mismatches (Zod vs TS types), temporal ordering bugs, enforcement gaps.
7
Invariant verification
Discovers pure functions, generates postcondition invariants, runs property-based tests, analyzes failures to distinguish real bugs from wrong invariants.
8
Write plans
Groups all findings into 1-12 actionable plans ordered by severity. Each plan: scope, effort, file-level changes, checklist. Every issue cites file + line range.
9-10
Present and execute
Shows the plan table. Say "do all" and it dispatches plans in parallel waves via subagents, verifying each wave before continuing.
Output: all findings go to audit/<package>/findings.md and audit/<package>/plans/. The deep-audit reads code itself — no subagent delegation during analysis phases — so it maintains full cross-file context.

for AI agents

One file is all
an agent needs.

Large monorepos exceed the context window of any AI model when loaded naively. supergraph.txt solves this: a pre-analyzed, structured map of every relationship in the codebase.

<500 lines
Fits in any context window
A 365-module monorepo compresses to ~500 lines. Attach it to any agent's context and it has a complete map — module paths, exports, imports, cross-package edges.
grep
Structured for search
Consistent format means agents can grep for any symbol, any package, any edge. "Where is X defined?" "What does Y export?" "Who imports Z?" — answered without reading source.
->
Cross-package edges explicit
The hardest relationships to infer from raw source are spelled out. Every inter-package import: labeled, directional, queryable. Agents stop confusing internal and external deps.
/deep-audit
Agent-native workflow
The deep-audit command is designed for AI agents from the ground up. 10 phases of systematic analysis, all written to disk, executable via subagent dispatch.

The HTML visualization is useful for humans exploring the graph interactively. But for AI agents, plain text is the native format. supergraph.txt is grep-able, diff-able, and small enough to fit in a single context window. The agent knows the architecture before writing a single line of code.


visualization

Interactive graph.
For humans.

supergraph also generates audit/supergraph.html — a fully self-contained, zero-dependency interactive visualization of the module graph. Physics simulation, search, package filtering, issue overlays.

Physics simulation
Force-directed layout with live physics. Nodes repel, edges pull. Toggle with p.
Zoom & pan
Scroll to zoom, drag to pan. Handles hundreds of nodes across dozens of packages.
Package legend
Every package gets a distinct color. Click a package to isolate it and its cross-package edges.
Issue overlays
Circular dependencies, missing exports, unresolved imports — overlaid directly on affected nodes.
Search
Fuzzy search across all module paths. Matching nodes highlight and the viewport snaps to the result cluster.
Symbol annotations
Click any node to see every exported symbol — functions, types, constants, classes — with full detail panel.
key action
p Toggle physics simulation
l Toggle module labels
Escape Close detail panel
scroll Zoom in / out
drag Pan canvas / pin nodes