mintwork

mintwork / whatbroke

Why did CI fail? See only what changed

whatbroke compares a failed job with the last run that passed and shows only the lines that are new, failure first. In your terminal, as a PR comment, or for your coding agent.

npx -y @mintwork/whatbroke   # the latest failed run on this branch
npx -y @mintwork/whatbroke <run or job URL>
The last 12 lines of ruff's failed CI log are only git cleanup; whatbroke on the same job shows the Rust compile error first, out of 2,206 lines; then the same result as a PR comment

The problem

A failed CI job is thousands of lines: dependency installs, download progress, deprecation warnings, every test that passed. The end of the log, where people and agents look first, is usually cleanup. GitHub's red annotation says "Process completed with exit code 1".

Most of those lines were also in the last run that passed. whatbroke hides everything the two runs share and shows what's left, so the failure is the first thing you read.

What it does

As a PR comment

Add a workflow that runs when your CI fails:

on:
  workflow_run:
    workflows: [CI]
    types: [completed]
permissions:
  actions: read
  pull-requests: write
jobs:
  explain:
    if: github.event.workflow_run.conclusion == 'failure'
    runs-on: ubuntu-26.04
    steps:
      - uses: mintwork/whatbroke@v0

For your coding agent

Tell it in AGENTS.md or CLAUDE.md:

When a CI run fails, run `npx -y @mintwork/whatbroke --agent`
and start from its output instead of reading the full job log.

How is this different?

Copilot's "explain error" and AI CI-fixers send your log to a model and summarize it. whatbroke doesn't guess: it shows the exact lines that changed since the last green run, offline, in a few seconds, with no account or API key. Use both: give the AI whatbroke's 40 lines instead of the whole log. The benchmark shows how it was measured, misses included.

Open source, MIT licensed

Built in CI and published to npm with signed provenance. The full docs, changelog and issues are on GitHub.