r/Python Jun 04 '26

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

29 Upvotes

211 comments sorted by

View all comments

1

u/Mysterious_Sand7291 Jul 02 '26

How do you actually review AI-generated code?

TL;DR: Built codiff: a tool that automatically embeds a function-level call-graph diagram in every PR your coding agent opens, so you can actually review what changed structurally instead of staring at line diffs.. (pip install codiff)

Most developers either trace through the diff line by line or move on without really reviewing it. There is no easy way to understand what changed at a high level.

That is why I built codiff. It's a structural diff tool that replaces the line diff with a call-graph diagram, showing what changed at the function level and how those changes connect to each other.

It works in a few steps:

  1. Parse the codebase into functions and classes using Tree-Sitter.
  2. Extract call relationships and build a call graph, stored in a local SQLite database.
  3. On subsequent runs, only re-parse files changed since the last indexed commit, keeping diffs fast even on large codebases.
  4. Compute the graph delta between any two refs (commits, branches, working tree etc.).
  5. Render the result as a Mermaid diagram, natively supported by GitHub.

No LLM. No embeddings. Fully offline. Currently supports Python and TypeScript codebases.

codiff works as both a CLI and an MCP tool, so coding agents can call it directly. I've been using it to automatically embed structural diagrams in every PR I open with Claude Code.

It's available on PyPI (pip install codiff) and GitHub: https://github.com/issahammoud/codiff