/understand-diff command maps your uncommitted or staged git changes to nodes in the knowledge graph, then traces a one-hop ripple to find every component that may be affected downstream. The result is a structured impact report with a risk assessment.
Run it before code review, before merging a branch, or any time you want to understand the blast radius of your changes.
Usage
git diff automatically.
How it works
Read git changes
Collects the list of changed file paths from git. Both staged and unstaged changes are included.
Map files to graph nodes
Each changed file is matched to a
file: node in the knowledge graph by its path. Any functions or classes contained in those files (via contains edges) are also included as changed nodes.Files that have no corresponding node in the graph are listed separately as unmapped files — these may be new files added since the last /understand run.Find affected components
All nodes connected to the changed nodes by any edge (1-hop neighbors) are collected as affected components — callers, importers, dependents, and related nodes.
Output
A structured markdown report with these sections:Examples
Related commands
/understand
Update the knowledge graph so diff analysis includes your latest files.
/understand-explain
Deep-dive into any component flagged in the diff report.
/understand-chat
Ask follow-up questions about the affected components.
/understand-dashboard
Visualize the impacted nodes and layers in the interactive graph.