Real projects span multiple repositories. A test framework in one repo, application code in another, shared utilities in a third. This lesson covers building cross-repo graphs so your AI agent can navigate between them.
After this lesson, you can give the AI a unified graph that spans multiple repos — so it understands how your test framework connects to the code it tests.
By default, each graphify . produces a project-local graph. The --global flag also merges the result into a shared graph at ~/.graphify/global-graph.json:
# Build project graph AND merge into global
graphify . --global
Do this for each repo you want in the unified view. The global graph accumulates nodes from every project.
# Check what's in the global graph
graphify global list
You need a cross-repo graph when the AI needs to understand boundaries that span repositories:
For your DocumentDB project, this might mean graphing both the performance test repo and the framework/utilities it imports — so the agent understands the full call chain from test case to assertion helper.
If you don't want a persistent global graph, merge two graph files on demand:
# Merge two project graphs into a combined file
graphify merge-graphs \
~/project-a/graphify-out/graph.json \
~/project-b/graphify-out/graph.json \
-o combined-graph.json
The merged graph shows cross-repo edges — imports that cross repository boundaries become visible connections.
Need to graph a repo you haven't cloned yet?
# Clone and graph in one step
graphify clone https://github.com/org/shared-framework.git
This clones to a temp directory, extracts the graph, and merges it globally. Useful for quickly adding context about a dependency without keeping a full local checkout.
Once you have a multi-repo graph, queries work across boundaries:
# Find path from your test to a framework utility
graphify path "test_min_comparisons" "assertResult" --graph combined-graph.json
# Explain a node in the framework repo
graphify explain "BaseTestCase" --graph ~/.graphify/global-graph.json
In an AI session, load the global graph instead of the project-local one for cross-repo awareness.
| Approach | Size | Freshness | Use case |
|---|---|---|---|
| Project-local graph | Small, focused | Easy to keep fresh | Single-repo tasks |
| Global graph | Larger | Needs rebuild per repo | Cross-repo navigation |
| On-demand merge | You control | Point-in-time | Specific investigations |
A multi-repo graph is bigger. If your combined graph exceeds 50k tokens, the savings ratio drops. Monitor with graphify benchmark --graph combined-graph.json — if the graph itself is a significant fraction of the codebase tokens, you may be better off with scoped project graphs.
What does the --global flag do when building a graph?
When should you not use a multi-repo graph?
graphify . --global on your primary project--global toographify global list to confirm both appeargraphify path between a node in each repo