open-source product · CLI + MCP · Apache-2.0
whatbrokegit-anchored crash capture for AI coding agents
tldr
whatbroke is a terminal-side capture layer for local Node and TypeScript crashes. You wrap a command you already run — whatbroke run npm test — and when it dies, whatbroke packages the error, the diff since the code last worked, and a deterministically-ranked guess at the responsible file, with secrets scrubbed, then serves it to your coding agent over a read-only MCP server. It diagnoses; it does not fix. The ranking uses no LLM and makes no network call.
install
npm install -g @whatbroke/whatbroke whatbroke run npm test # wrap any dev command whatbroke mcp # start the read-only MCP server for your agent whatbroke show # print the latest redacted bundle whatbroke doctor # check your setup
how it works
The pipeline is crash → capture → git-anchored context → deterministic suspect ranking → redaction gate → MCP.
Every time the wrapped command passes, whatbroke records the current commit as “green” in a local journal, keyed by the normalized command and branch. When the command fails, it intersects the files on the crash stack trace with the files changed since that last green commit and scores them with fixed integer weights — a file both on the stack and changed since green ranks highest. That is the moat: accumulated local ground truth a SaaS monitor cannot see and an LLM cannot reproduce from a prompt.
Before anything leaves the process, a mandatory redaction gate scrubs secrets — the bundle type is branded so it is a compile-time error to route an unredacted bundle to any output. The MCP server is read-only and stdio-only, exposing tools like get_suspects, get_diff_vs_green, and get_logs to your agent.
vs the alternatives
| whatbroke | raw stack trace | Sentry | git bisect | |
|---|---|---|---|---|
| Where it runs | Local terminal | Local terminal | Production | Local terminal |
| Names the file | Yes, ranked | Sometimes | Yes (prod errors) | Finds commit, not file |
| Uses git history | Diff since last green | No | Release tags | Bisects commits |
| Agent-ready (MCP) | Yes | No | No | No |
| Secrets scrubbed | Mandatory gate | No | Configurable | n/a |
| Deterministic | Yes, no LLM | n/a | n/a | Yes |
faq
How does deterministic bug ranking work without an LLM?
whatbroke intersects the files on the crash stack trace with the files changed since the last passing run of the same command, then scores them with fixed integer weights. There is no model call and no randomness — the same crash produces byte-identical output, which a test in the repo asserts.
Does it work with Claude Code and Cursor?
Yes. whatbroke runs a local read-only MCP server, so any MCP-aware coding agent — Claude Code, Cursor, and others — can pull the ranked suspects, the diff since the last green commit, and the redacted logs directly into context.
Is whatbroke a replacement for Sentry?
No. Sentry monitors production; whatbroke captures the local terminal crash — the test or server that died in your shell before anything shipped. They are complementary and fill different gaps.
What languages does it support?
Node and TypeScript projects in v1, with parsers for the major test runners. Source-map resolution and non-Node languages are on the roadmap.
related
Other projects: Klinder-OSS · AHTML · Diffcore · Roy UI · all work · about the maker
Built by Dibbayajyoti Roy. Questions or want to use it? Get in touch.