Measuring the effect
A hotspot ranking is a prediction: "fix this and you get the most back". Until you fix something and measure how far the complexity actually moved, the claim is untested.
dowsing diff closes that gap.
dowsing diff origin/main📉 Measured complexity (base → head):
cognitive -41 / cyclomatic -22 / LoC -111Negative numbers are improvements. When nothing improved, that is reported as it is.
How it works
For every changed file, dowsing reads the source at both revisions — straight from git, not from your working tree — parses each one, and subtracts.
That has a useful consequence: it does not care who made the change. A hand-written commit, an agent's refactor, an automated codemod, or a PR in CI all measure the same way. There is nothing to opt into and no model to call.
dowsing does not do the fixing
Earlier versions had a dowsing fix that delegated the edit to Claude Code, verified it, and measured the delta. It worked — but the usual call path is agent → dowsing, and having dowsing launch another agent inside that call inverts the relationship. The outer agent has the conversation, the review loop, and the user; it is in a far better position to make the change.
So the fixing was removed and the measuring was kept. In exchange, measuring got cheaper and more frequent: it now runs on every PR instead of only on changes dowsing itself caused.
In a pull request
dowsing diff origin/main --markdownThe Markdown output carries the risk of what the PR touched and the complexity delta, ready to post as a comment.
| metric | base | head | delta |
|---|---|---|---|
| cognitive | 180 | 139 | -41 |
| cyclomatic | 96 | 74 | -22 |
| LoC | 620 | 509 | -111 |
A ready-made workflow lives in templates/github-actions/. Remember fetch-depth: 0 — with a shallow clone there is no history to measure against.
What it does not tell you
- It does not judge the change. Complexity going up is not automatically bad: a genuine new feature adds branches. The number is context for a reviewer, not a gate.
- It only sees analysable files.
.ts/.tsxsources that are not generated or vendored. - It is not a quality score. For a threshold you can fail a build on, use
dowsing check.