Cost and coverage
AbstractEvery review is estimated before anything is sent to the model, refused over a limit you set, capped at one model call, and cached. Whatever it could not check is written into the report instead of being left out.
The estimate comes first
--estimate makes zero model calls. It performs the same diff preparation and static checks as a review, and reports what the complete prompt would cost.
The estimate covers the whole prompt: the review rubric, a fixed instruction, the scanner evidence that sits on lines the patch shows, and the line-numbered patch itself. PR-Agent's token estimator counts it.
A real estimate
The run below is real. --estimate was run on a throwaway repository with a two-file change: a shell script that leaves two variables unquoted, and a workflow that passes a pull request title into an inline script. ShellCheck and actionlint found all three problems. No model was called.
--estimate on a throwaway repository.- Command
cursor-review --repo /tmp/example --base main --estimate- Exit status
- 0
- Length
- 1,419 estimated tokens against a limit of 6,000
- Findings
- 3: one from actionlint, two from ShellCheck, none from a model
- Coverage
- Both changed files were checked in full. No path was left out.
- {
- "provider": "cursor",
- "source": "/private/tmp/example",
- "head": "1a64c12013445ed5cfcb8679b73c5ab5c2d9f02f",
- "model": "cursor-default",
- "estimated_input_tokens": 1419,
Comment 1, on line 6: The whole prompt, counted before anything is sent: 1,419 tokens, against the limit on the next line.
- "max_input_tokens": 6000,
- "cursor_invocations": 0,
Comment 2, on line 8: No model was called.
--estimateprepares everything a review prepares, and stops. - "cache_hit": false,
- "omitted": [],
Comment 3, on line 10: No path was left out. Every changed file had a usable patch.
- "checks": [
- {
- "tool": "actionlint",
- "path": ".github/workflows/ci.yml",
- "state": "complete",
- "findings": [
- {
- "path": ".github/workflows/ci.yml",
- "rule": "expression",
Comment 4, on line 19: actionlint's finding: a pull request title passed straight into an inline script.
- "line": 11,
- "message": "\"github.event.pull_request.title\" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details"
- }
- ]
- },
- {
- "tool": "shellcheck",
- "path": "deploy.sh",
- "state": "complete",
- "findings": [
- {
- "path": "deploy.sh",
- "rule": "SC2086",
Comment 5, on line 32: ShellCheck's: two unquoted variables, on lines 4 and 5.
- "line": 4,
- "message": "Double quote to prevent globbing and word splitting."
- },
- {
- "path": "deploy.sh",
- "rule": "SC2086",
- "line": 5,
- "message": "Double quote to prevent globbing and word splitting."
- }
- ]
- }
- ],
- "findings": [],
Comment 6, on line 45: Model findings. Empty, because no model ran. The scanners' findings sit under
checks. - "cursor_usage": null,
- "state": "estimate",
Comment 7, on line 47: The state decides the exit status.
estimateis 0. - "model_invocations": 0,
- "model_usage": null
- }
When the estimate is too large
An estimate above the limit ends the review before the model is invoked. The state is over-budget, the exit status is 2, and the static checks and history advisories are still reported.
The overview quotes one such review from the project's own pull request #15. Thirty-five minutes later the same pull request was reviewed again at a later head:
- Manuscript
medici-finance/assay-pr-agent#15, revisionc609020; posted byassay-pr-agent[bot]on 26 November 2026- Recommendation
- Not reviewed: over budget
- Length
- 12,645 estimated tokens against a limit of 6,000
- Findings
- None. Hadolint found nothing at this revision.
- Coverage
- The model review was skipped. History was unavailable.
- Codex review of c609020b9ec08fa35e18dea33f5dfd7db779b837
- over-budget
- Skipped Codex. Estimated prompt 12645 tokens exceeds the limit of 6000.
Comment 1, on line 3: Still over the limit, and larger: 12,645 estimated tokens.
- Static checks
- hadolint: 0 CI, 1 local, 0 findings, 0 incomplete.
Comment 2, on line 6: No findings this time. The Dockerfile problems of the earlier head had been fixed, and the scan says so.
- Qualgen history unavailable for this review.
- Review tooling built on PR-Agent.
- On-behalf-of: human:review-operator mode:unattended
Repeat --path path/to/file to review an exact changed path, or split the change.
Where the limit comes from
The limit is 6,000 estimated input tokens by default. Three things can change it, and the first one found wins:
| Source | Scope |
|---|---|
--max-input-tokens | One run |
REVIEW_MAX_INPUT_TOKENS in the environment | That container |
The REVIEW_MAX_INPUT_TOKENS setting saved by setup | The saved setup, which the wizard asks for |
| 6,000 | When none of the above is set |
One call, at most
Each run can launch the provider CLI once, with a 120-second timeout and at most three accepted findings. There is no model fallback, repair prompt, automatic retry or model polling.
The cap covers the prompt the reviewer submits. The CLI controls its own system context, its own output and its own billed usage. model_usage is filled in only if the CLI supplies it.
The cache
A successful result is cached, and a repeated request does not pay again.
| Where it lives | When |
|---|---|
~/.cache/cursor-pr-review, or under XDG_CACHE_HOME | The command line on its own |
/state/cache | Reviews run by the poller, which passes --cache-dir |
The container image sets XDG_CACHE_HOME=/tmp/.cache, because its root filesystem is read-only. That covers a cursor-review run by hand inside the container.
A result is reused when all of these match the earlier run:
- The prompt: the same patch and the same scanner evidence.
- The scope, and the model.
- The source, meaning the change's address or the repository path.
- The provider, and for Cursor the team.
The commit's SHA is not among them. A new commit that leaves the patch unchanged hits the cache.
A lock serializes duplicate local requests. For CI reuse across jobs, provide a persistent, trusted --cache-dir; each ephemeral runner otherwise starts cold. Use an explicit model for results you can compare.
Coverage
A review can come back with less than was asked for, and says so each time.
| Written in the report | When |
|---|---|
A path under omitted | A file has no usable patch or no head-side location, as for a whole-file deletion, or was excluded by --path. |
A check with the state could-not-check, and a reason | A scanner could not run. Static checks lists the reasons. |
Outside review coverage in the comment | Any omitted path, repeated where people read it. |
Scanner findings are kept apart from model findings in the JSON. Missing scanner evidence stays visible even when the model finds nothing. Whenever anything is omitted or could not be checked, the state is partial and the exit status is 2.
Exit status
| Exit status | Meaning |
|---|---|
| 0 | The requested review or estimate completed in full. A review with findings also exits 0. |
| 2 | Partial coverage, a budget refusal, a model or tool error, or a publication failure. |
Output and exit codes lists the six states behind them and every field of the report.