Skip to content

aspens doc graph

Rebuild the import graph cache. The graph runs automatically during doc init and doc sync, but you can trigger it manually.

Terminal window
npx aspens doc graph [path]
ArtifactPathPurpose
Graph data.claude/graph.jsonFull dependency map with hub files, clusters, edges
Graph index.claude/graph-index.jsonCompact lookup table for file-to-domain resolution
Code map.claude/code-map.mdHuman-readable codebase overview

code-map.md gives agents a codebase overview on every prompt:

  • Hub files (most-imported, with fan-in counts)
  • Domain clusters (which files group together)
  • Hotspots (high-churn files)
  • Stats (file count, edge count, cluster count)
OptionDescription
--verboseShow diagnostic output
--removeRemove graph artifacts from the repo

A graph context hook can inject navigation context into every Claude prompt. When you edit a file, the hook looks up its neighbors, hub files, and domain cluster from the graph.

Install it with:

Terminal window
npx aspens add hook graph-context