What
Estimate what a review round will cost before firing it, and show that estimate wherever crq is about to spend money — the queue, the repo adder's backlog step, and PR detail. Then record what it actually cost, so the estimate can be checked against reality.
Today crq reasons about one scarce resource: CodeRabbit's review allowance, counted in reviews. That was the whole picture when the primary was the only metered reviewer. It isn't any more — Macroscope bills per kilobyte of diff, CodeRabbit bills per file once you're past your plan, and autofix agents burn tokens. None of that is visible anywhere in crq.
The data already exists
Most of the inputs are either published or already sitting in our own corpus, captured and discarded:
| Source |
What it gives |
Status |
internal/dialect/testdata/coderabbit/cli-rate-limit.json |
"isProUser": false, "policyGuidance": "…You're only billed for reviews past your plan's rate limits ($0.25/file)" |
captured; ParseCLIError reads only errorType, recoverable, metadata.waitTime, metadata.orgAttributed and drops the rest |
internal/dialect/testdata/macroscope/check-custom.json |
**Agent Credits:** 81 credits |
captured, unparsed |
| Macroscope check-run detail page |
the billed cost of that run |
not read |
Autofix agent stream-json output |
token usage per fix session |
written raw to the session log, never parsed |
Published pricing, checked 2026-07-27 (re-verify before displaying — CodeRabbit's figures are roughly double the widely-cited historical ones):
- Macroscope — $0.05 per KB of diff reviewed, 10 KB minimum, so a $0.50 floor per review. Caps: $10 per review, $50 per PR, plus an account monthly spend limit.
- CodeRabbit — Pro $24/dev/mo annual ($30 monthly), Pro+ $48/$60. Overage is usage-based: $1.00 per credit at $0.25 per reviewed file (4 files/credit), $20 minimum auto-refill. Only engages once the plan allowance is exhausted.
- Codex and Cursor Bugbot cost nothing per review — they're covered by their own subscriptions.
Estimate
For a given head, we know the diff. That's enough:
- Macroscope:
max(10, diff_kb) × $0.05, clamped by the $10 per-review cap. Note the diff basis is incremental after the first review — HEAD vs the previously reviewed HEAD, not vs merge base.
- CodeRabbit:
$0 while inside the plan allowance; changed_files × $0.25 once past it. So the estimate depends on remaining allowance, which crq already tracks in AccountQuota.Remaining.
- Autofix: no published unit price; estimate from prior sessions on that repo once we're recording actuals, and show nothing until then rather than inventing a number.
Show a single per-round figure with a per-bot breakdown behind it, and label it an estimate. Where the number is unknown, say unknown — a wrong cost figure is worse than no cost figure.
Where it appears
- Queue rows / fire confirmation — the estimate for the round about to fire.
- Repo adder, start-policy step — this already says "would enqueue 7 open PRs; ~7 metered reviews". It should also say what that costs. This is the single place in the product where someone can spend real money in one click.
- PR detail — estimate before, actual after.
- Fleet settings — spend to date, balance and monthly-cap headroom, and whether pay-as-you-go is even enabled.
Actuals
Parse the billed cost from Macroscope's check-run detail and **Agent Credits:** from its check body; parse token usage from the autofix agent's stream-json. Store alongside the round so estimate-vs-actual can be compared, which is the only way to find out whether the model above is any good.
Notes
- crq has no time series — state is a snapshot plus a 50-entry archive ring evicted by count. Spend-over-time needs a journal, or walking the state ref's git history. That decision blocks the "spend to date" half of this, but not the estimate itself.
- Every displayed price carries a "last checked" date and links to the vendor page. Prices drift; a stale hardcoded number that looks authoritative is a bug.
- CodeRabbit's files-per-review cap (150 Pro / 300 Pro+) is separate from the review allowance. A PR over the cap needs an explicit, billed "Review on demand" — worth catching in the same pre-flight arithmetic rather than discovering mid-round.
Ref #59
What
Estimate what a review round will cost before firing it, and show that estimate wherever crq is about to spend money — the queue, the repo adder's backlog step, and PR detail. Then record what it actually cost, so the estimate can be checked against reality.
Today crq reasons about one scarce resource: CodeRabbit's review allowance, counted in reviews. That was the whole picture when the primary was the only metered reviewer. It isn't any more — Macroscope bills per kilobyte of diff, CodeRabbit bills per file once you're past your plan, and autofix agents burn tokens. None of that is visible anywhere in crq.
The data already exists
Most of the inputs are either published or already sitting in our own corpus, captured and discarded:
internal/dialect/testdata/coderabbit/cli-rate-limit.json"isProUser": false,"policyGuidance": "…You're only billed for reviews past your plan's rate limits ($0.25/file)"ParseCLIErrorreads onlyerrorType,recoverable,metadata.waitTime,metadata.orgAttributedand drops the restinternal/dialect/testdata/macroscope/check-custom.json**Agent Credits:** 81 creditsstream-jsonoutputPublished pricing, checked 2026-07-27 (re-verify before displaying — CodeRabbit's figures are roughly double the widely-cited historical ones):
Estimate
For a given head, we know the diff. That's enough:
max(10, diff_kb) × $0.05, clamped by the $10 per-review cap. Note the diff basis is incremental after the first review — HEAD vs the previously reviewed HEAD, not vs merge base.$0while inside the plan allowance;changed_files × $0.25once past it. So the estimate depends on remaining allowance, which crq already tracks inAccountQuota.Remaining.Show a single per-round figure with a per-bot breakdown behind it, and label it an estimate. Where the number is unknown, say unknown — a wrong cost figure is worse than no cost figure.
Where it appears
Actuals
Parse the billed cost from Macroscope's check-run detail and
**Agent Credits:**from its check body; parse token usage from the autofix agent'sstream-json. Store alongside the round so estimate-vs-actual can be compared, which is the only way to find out whether the model above is any good.Notes
Ref #59