diffew

The diff of what your code did.

Run your tests after each agent turn. See what each test did differently.

npx diffew
~/shop/agent-a
# agent: refactor loadProducts
diffew run shop -- pnpm test:e2e
diffew run 20261019T093304Z: shop/desktop
service shop node :3000 recording
✓ cart.e2e.test.ts (5 tests) 341ms
✓ checkout.e2e.test.ts (9 tests) 574ms
Tests 14 passed (14)
diffew compare shop
shop agent/checkout b71d03f → 0c5e8a1 paired with the previous run
14 tests 1 changed "checkout > places an order"
1 server call changed loadProducts postgres 1 → 12 statements
http://localhost:4400/w/3f9a1c07e2/api/shop
diffew1 test changed

checkout > places an order

52 → 136 ms

POST /orders201
createOrder
select carts
loadProducts
~select products×12
insert orders
insert order_items
publish order.created

The agent refactored loadProducts. All 14 tests pass. diffew flags one change in checkout > places an order: select products now runs 12 times in a row instead of once, and the test takes 84 ms more. 13 tests did not change.

Don’t read the code diff. Read what it did.

claude/checkout-refactor

The diff to show

What it flags

An N+1 query

postgres

A new external call

http

A slower query

postgres

A message that is gone

kafka

A screen changed

ui

A comment on each pull request

What each test did differently, right on the pull request. Cloud

github.com/acme/shop/pull/482

Refactor checkout into createOrder, add card payments #482

Openclaude wants to merge 3 commits into main

  1. claude commentedAuthor

    Summary

    Moves order creation into createOrder and adds card payments.

    • loadProducts takes the cart items.
    • New chargeCard client for the payments API.
  2. diffew bot commented

    Behaviour changed in 2 of 14 tests against main

    TestWhat changed
    checkout › places an order~12 sequential select products (was 1) · +84 ms
    checkout › pays by card+1 HTTP call POST /charge · +120 ms

    View the diff →

Agents check their own work.

The same facts, as text. The agent fixes what it did not mean to change.

claude — ~/shop

A Claude Code session. The user asks: add card payments to checkout. Claude updates src/orders/checkout.ts, then runs the tests under diffew and compares the runs. diffew reports that loadProducts now takes 41 ms instead of 4 and runs 12 postgres statements instead of 1, and that chargeCard is new. Claude says that it is 10 times slower because of an N+1, and loads the products in one query. It runs diffew again against main: the only server call that changed is chargeCard, added. Claude says: Verified, the only new behaviour is the card charge.

Open source and cloud

Open source

Runs on your machine

CLI and desktop app. Apache-2.0.

npx diffew
Star on GitHubmacOS · soon

Hosted by you

  • Freein CI, on every run
  • 4runners: Vitest, Jest, node:test, Playwright
  • Localruns stay in your repository
  • Per turneach worktree, each agent

Cloud soon

Hosted by us

For teams and pull requests.

Everything in open source, plus

  • Hosted runs, baselines from main
  • A comment and a check on each pull request
  • Diffs you share with a link
  • Trends per test over time