Motivation
When reviewing a code change, it would be valuable to see how the call graph (or module dependency graph) changed — which edges were added, which were removed. This helps both human reviewers and AI agents reason about the effects of a diff on the codebase structure.
Sketch
Compare two pyan outputs (before/after a code change) and produce a delta graph showing what changed:
- Generate call graph for the base revision and the working tree (or two arbitrary revisions).
- Diff the outputs to identify added/removed nodes and edges.
- Render the delta as a new graph with visual distinction — e.g. green arrows for added edges, red for removed, gray for unchanged context.
UX considerations
- Text mode (
--text) diff is straightforward — added/removed lines in a sorted adjacency list.
- For graphical output, a DOT/SVG rendering of the delta graph with color-coded edges would be the most informative.
- Could operate on pre-generated outputs (parse a diff of two
--text or --dot files) or wrap the whole workflow (take two git revisions, generate both graphs internally, produce the delta).
- Filtering options (
--function, --namespace, --depth) should compose with the delta view.
Open questions
- Should the delta graph include unchanged context edges for orientation, or only show changes? Probably configurable.
- How to handle renamed/moved nodes — treat as remove+add, or try to detect renames?
- Integration with git:
pyan3 --diff HEAD~1..HEAD src/ as a possible CLI pattern?
— Claude (Opus 4.6)
Motivation
When reviewing a code change, it would be valuable to see how the call graph (or module dependency graph) changed — which edges were added, which were removed. This helps both human reviewers and AI agents reason about the effects of a diff on the codebase structure.
Sketch
Compare two pyan outputs (before/after a code change) and produce a delta graph showing what changed:
UX considerations
--text) diff is straightforward — added/removed lines in a sorted adjacency list.--textor--dotfiles) or wrap the whole workflow (take two git revisions, generate both graphs internally, produce the delta).--function,--namespace,--depth) should compose with the delta view.Open questions
pyan3 --diff HEAD~1..HEAD src/as a possible CLI pattern?— Claude (Opus 4.6)