DiffCarve
A CLI and GitHub Action that carves an oversized AI-authored pull request into a dependency-ordered stack of sub-200-line pull requests, each gated by a reviewability score.
DiffCarve
A CLI and GitHub Action that carves an oversized AI-authored pull request into a dependency-ordered stack of sub-200-line pull requests, each gated by a reviewability score.
Problem
AI coding agents write whole features in one pass, so pull requests are landing 3.5x bigger than they used to, and the humans reviewing them haven't gotten any faster. GitHub shipped Stacked Pull Requests into public preview on August 18, 2026 specifically to give reviewers a way to split large changes into dependent, independently reviewable chunks, but it's a manual workflow. Someone still has to decide where to cut the branch, and nothing stops a 1,400-line "add feature X" commit from landing as a single PR in the first place.
Target user
A tech lead or staff engineer at a 20-to-200-person engineering org where most of the team uses Claude Code, Cursor, or Copilot to generate large chunks of a feature at once. They've watched PR size creep up and review comments thin out, and they don't want to run a training session teaching every engineer to manually stack commits before opening a PR. What they want: when someone opens a giant AI-generated PR, it gets broken into a reviewable stack before a human ever has to scroll through the full diff.
MVP scope
- CLI (
diffcarve analyze <branch>) that partitions a diff into dependency-ordered logical layers (schema migration, then data-access layer, then API route, then UI) using file and module boundaries plus import-graph analysis, rather than blind line-count buckets. - GitHub Action that runs on PR open and, when the diff crosses a configurable line or file threshold, opens the partitioned layers as a native GitHub Stacked Pull Request chain instead of the original monolith.
- A per-layer reviewability score (lines changed, files touched, cyclomatic complexity delta, reverse-dependency count) posted as a PR check; any layer over the configured threshold fails the check and blocks merge until it's split further or a second reviewer explicitly overrides it.
- Repo-level config file (
diffcarve.yml) for line budget, complexity threshold, and file-boundary rules per language. - Two supported stacks at launch, TypeScript/JavaScript via ts-morph's import graph and Python via the standard
astmodule, since those cover most AI-agent-authored repos today. --dry-runmode that posts the proposed stack layout as a PR comment without blocking merge, so a team can see what it would do before turning on enforcement.
Monetization
Freemium. The CLI and GitHub Action are MIT-licensed and free for any repo under a 10-seat cap per organization. A paid tier ($15–25 per developer per month) adds org-wide reviewability trend dashboards, Slack/Teams alerts on repeat offenders, and one config that enforces the same policy across every repo: the thing a platform or DevEx team wants once a single team's pilot has already worked.
Why now
GitHub's Stacked Pull Requests moved to public preview on August 18, 2026, which gives DiffCarve a native format to target instead of building a proprietary UI. At the same time, Cortex's 2026 engineering benchmark report found incidents per pull request up 23.5% and change failure rates up roughly 30% year over year, driven by AI acting as what the report calls an "indiscriminate amplifier" of whatever review discipline a team already had. The primitive for splitting a diff now exists on the platform teams already use; nothing yet decides where to make the cuts automatically.
Risks & open questions
- Will an engineering lead actually leave a merge-blocking check turned on, or click past it the first time it holds up a release? The
--dry-runadvisory mode needs to be the real on-ramp, not a footnote. - Reliable dependency-ordered splitting is the hard part. Import-graph analysis handles clean layered changes well; an AI agent's PR with tangled, cross-cutting edits may not partition cleanly at all.
- GitHub's Stacked PR API is still in public preview, and the programmatic surface for opening a stack from an Action may change or be missing pieces this MVP needs.
- Graphite already owns stacked-diff tooling, and GitHub itself could ship auto-splitting as a first-party feature, since both control the underlying primitive DiffCarve depends on.
- The reviewability score is a proxy for "will a human actually read this," not a measurement of it, and could be gamed by an agent padding a layer with boilerplate to duck under the line budget.
Next step
Build the TypeScript-only CLI against ten real oversized PRs (a mix of the founder's own repos and public open-source PRs) and check whether the auto-partitioned layers make sense to a reviewer before touching the GitHub Action or the merge gate.
Sources
- https://www.infoq.com/news/2026/08/github-stacked-pull-requests/ — GitHub Stacked Pull Requests reached public preview on August 18, 2026, giving teams a native way to split large changes into dependent, independently reviewable PRs
- https://www.cortex.io/post/ai-is-making-engineering-faster-but-not-better-state-of-ai-benchmark-2026 — Cortex's 2026 benchmark report: incidents per pull request up 23.5% and change failure rates up roughly 30% as AI adoption grew, with the effect concentrated at teams lacking prior review discipline