Your AI coding agent passed the tests. The PR was still bloated.
PatchDiet shrinks AI-generated pull requests into the smallest reviewable patch that still passes your checks.
npx patchdiet shrink --base origin/main --head HEAD --test "pnpm test"Before PatchDiet:
- 4 files changed
- 14 changed lines
- 4 hunks
- tests passing, but review scope is inflated
After PatchDiet:
- 1 file changed
- 4 changed lines
- 1 hunk
- tests still passing
- cleanup patch generated
- line reduction: 71%
- unrelated refactors
- formatting-only hunks
- stale comments
- dependency bumps outside scope
- files that do not affect the requested behavior
PatchDiet is not an AI code reviewer.
It is not a coding agent.
It does not upload your code.
It is a patch minimizer for AI-generated diffs.
patchdiet initpatchdiet check --base origin/main --head HEADpatchdiet shrink --base origin/main --head HEAD --test "node --test"patchdiet shrink --base origin/main --head HEAD --test "node --test" --create-branchpatchdiet report --format githubpatchdiet report --format json
packages/core: diff parsing, config, shrink enginepackages/report: markdown/html/github rendererspackages/cli: command line interfacepackages/action: GitHub Action wrapperexamples/*: reproducible demo scenarios
- local-first by default
- no source upload
- does not rewrite the current branch in place
- produces cleanup artifacts under
.patchdiet/
v0.1 currently ships conservative hunk-level reduction and reproducible TypeScript, Python, and monorepo demo flows. AST-level atoms, richer dependency reasoning, and benchmark datasets are planned but not included in this version.
