Skip to main content
Get started
Graph Files
How .graph.* sidecars give AI agents a live map of your codebase
Supermodel’s CLI workflow is built around graph files: small
Supermodel writes this file next to it:
The graph file is plain text. Your AI coding agent can read it with the same tools it already uses to read source code:
The exact content depends on the language and the graph data available for that file. The important part is the shape: dependencies, calls, and impact are already summarized before the agent starts reading source.
It builds the graph, writes sidecars, listens for file-change notifications, and refreshes affected graph files as you code. Stop it with
Both commands write
Use
Preview cleanup first:
With graph files, the task starts like this:
The graph file does not replace source code. It gives the agent a map before it reads the source code.
.graph.* sidecars written next to your source files.
If your repo has this file:
cat, grep, editor context, or normal file search. No MCP server is required. No special editor integration is required.
Why graph files live next to source files
AI agents spend a lot of time rebuilding a map of your repo. Before they can safely change one function, they need to know:- What imports this file
- What this file imports
- What functions call this function
- What this function calls
- What could break if this file changes
What is inside a graph file
A graph file is a compact text summary of the relationships around one source file. Most graph files include three sections:How agents use graph files
The recommended pattern is:- Run the watcher:
- Tell your agent that graph files exist:
- When the agent works on
src/cache.ts, it readssrc/cache.graph.tsfirst.
Watcher vs one-shot analysis
The baresupermodel command is the live graph watcher:
Ctrl+C; generated sidecars are cleaned up on shutdown.
Use analyze when you only want one graph refresh and then exit:
.graph.* sidecars by default. Use --no-shards with analyze if you want cache/API output without writing graph files:
Cache and freshness
Supermodel caches analysis results locally by repo content hash. Commands likedead-code, blast-radius, focus, find, and graph reuse that cache when possible.
Use --force on analysis commands when you want to bypass the cache:
clean when you want to remove generated graph files without running the watcher:
Before and after
Without graph files, a typical agent task starts like this:Next
- Start with the CLI quickstart
- Read the
supermodelwatcher reference - Use
analyzefor one-shot graph generation - Use
skillto add graph-file instructions to your agent prompt
