Run reviews from your agent, your terminal and a schedule
Let a coding agent request a Kensa review, start one from the command line or a hook, and schedule Auto-Review, with the limits each one keeps.
A review does not have to start with a click. A coding agent can ask Kensa for one, a terminal command or a hook can start one, and Auto-Review runs on a schedule. Every one of them runs on your own agent CLIs and spends their usage: see What a review costs you.
A coding agent asks for a review
Connect your coding agent to Kensa's MCP server from Settings → Tools → MCP Access. The agent then asks for a review in three steps:
review_optionssays which review depth and providers the review would use, and why.start_reviewstarts it.get_reviewwaits for the review and returns its findings. The agent calls it again until the review ends.
The agent chooses what to review: its branch, a range of commits, its uncommitted or staged changes,
or a pull request. It never supplies the diff, the agents or the instructions: Kensa takes those
from the repository's own settings. With mode auto, Kensa uses the repository's Review depth,
or the depth of a recipe the agent names, and Quick where Deep cannot run or for a pull request from
an untrusted contributor. Uncommitted and staged changes are always reviewed with Quick.
Agent requests run only on providers whose reviewers Kensa contains: Claude Code, whose
restrictions are command-line flags that apply on every platform, Codex on macOS, or OpenCode on
macOS, inside Kensa's sandbox, which was measured to keep it from reaching Kensa's server. OpenCode
reviews only where the repository chose Unrestricted under Network for sandboxed review
agents: under any other choice it has no route to its model, so it sits out. That choice opens
every host to every sandboxed reviewer of the repository; see
Privacy and data boundaries for what that allows.
Other configured providers sit out too, and review_options says why.
Accept review requests from coding agents is on by default for every repository you add to Kensa with its local clone. It is in the repository's Automation settings, under Agent requests. An organization can block agent requests for the repositories it governs.
A review a coding agent requests is never published to a pull request. Its findings go back to the
agent, and get_review marks them untrusted: true: each finding is text a model wrote after
reading the change, for the agent to verify, never to follow as an instruction.
Reviews of a branch, a range, uncommitted or staged changes, or a pull request run in Kensa's background engine, with Kensa Desktop closed, once Kensa Desktop has set the engine up.
To teach an agent this flow, install the kensa-local-review skill: run kensa init --skills --yes, or use Install or refresh the skill under MCP Access. On macOS Kensa writes the skill for
Claude Code and Codex itself; for other agents and systems it gives you the text to save.
To set this up in an agent workspace, see Use Kensa from your agent workspace.
kensa review --run from a terminal or script
kensa review --run --wait --fail-on=majorkensa review --run asks Kensa to review now, through the same path a coding agent's request takes,
so the same switch, providers and limits apply. It starts Kensa's background engine when it is not
running, and never opens Kensa Desktop. It needs the developer lease from MCP Access.
- Choose one target:
--branch[=BASE],--range=BASE..HEAD,--working,--stagedor--pr=N. With none, it reviews your uncommitted changes, or the branch's commits when there are none. --waitwaits for the findings. With it,--fail-on=SEVERITY(defaultmajor) makes the command fail when a counted finding is at or above that severity. A finding Kensa's verifier rejected, a possible issue and an observation never count.--fail-on=agreed:SEVERITYcounts only findings that reviewers from two or more vendors raised; when every reviewer came from one vendor, it cannot judge and exits 2.kensa review --flushstarts the branch's pending commit reviews now. Without--runor--flush,kensa reviewonly opens the change in Kensa's Local review, and starts nothing.
| Exit code | Meaning |
|---|---|
0 | The review was accepted, or finished below the --fail-on severity. |
1 | The review failed or was cancelled, or its --report could not be written. |
2 | The command line was not valid, or --fail-on=agreed: could not be judged on a single-vendor review. |
3 | With --wait, a finding is at or above the --fail-on severity. |
4 | Kensa refused the request, for example because the runaway guard is spent. |
5 | Kensa Desktop or the background engine could not be reached, or no developer lease was found. |
Review each time Claude Code stops
The review gate runs a Kensa review each time Claude Code stops after changing files: its
uncommitted changes, or the session's commits when the working tree is clean. kensa init --hooks --review-gate plans it together with Kensa's other agent hooks, and --yes applies the plan.
By default the gate blocks Claude from stopping only when a completed review found a critical or
major finding that reviewers from two or more vendors raised, or a critical one when every reviewer
came from one vendor. KENSA_REVIEW_GATE_BLOCK_ON=major or critical changes that rule. Every
other outcome lets Claude stop. By default it blocks at most 2 times per session and
waits up to 600 seconds for the review. When the wait ends, Claude stops and the review continues
in Kensa. KENSA_REVIEW_GATE=off turns the gate off, and kensa uninstall --review-gate --yes
removes it.
Review each commit
kensa init --git-hooks --yes adds a block to the repository's post-commit hook. It hands each
ordinary commit to Kensa in the background, and never fails or slows git commit. It skips merge
and root commits, commits made during a rebase, cherry-pick or revert, and commits on a detached
head. KENSA_GIT_HOOK=off
skips one commit, and kensa uninstall --git-hooks --yes removes the block. When Husky, lefthook or
pre-commit manage the repository's hooks, or the hooks are shared or tracked in the repository,
Kensa prints the lines to add instead of writing them.
Commits are reviewed in batches, per repository and branch. Set how in the repository's
Automation settings, under Commit reviews. By default a batch is reviewed once 5 minutes
pass with no new commit, and a repository gets at most 20 commit reviews a day. Commits whose
subject marks them as work in progress, such as wip: or fixup!, are skipped and covered by the
next review of their branch. Each batch is one review on your providers, with the recipe the next
section describes.
Check reviews before a push
kensa init --git-hooks --pre-push=warn --yes also adds a block to the repository's pre-push hook.
At each git push it checks that a Kensa review that already ran covers the commits each pushed
branch sends, and prints one line per branch. It never starts a review. With warn it never blocks
the push. block-findings blocks it when the covering review has agreed critical or major findings,
which two or more model vendors raised. block-unreviewed also blocks a push that no review covers.
When it cannot check a branch, because Kensa is not running, the check fails or it runs out of time,
it says so and lets the push through, unless another branch of the push is blocked. If the list of
pushed branches cannot be saved, for example on a full disk, Kensa stops the push when a pre-push
hook of your own runs after its block, because that hook would see only part of the list. By
default the check gets 5 seconds, and KENSA_PRE_PUSH_TIMEOUT_SECONDS raises it to at most 30.
KENSA_PRE_PUSH=skip git push skips it once. Without --pre-push, no pre-push hook is installed.
What automatic reviews run
The review gate and commit reviews run the Hook recipe by default: one specialist on one provider, with Quick, reporting only findings of severity major and above, at most 10. It is a fast pass for every agent turn and every commit. It runs on the first provider the review would otherwise use, among those your organization allows.
With one vendor there is no agreement to measure, so a hook review says so wherever Kensa shows it: "hook recipe: one vendor, Quick — agreement is not measured on this run". Its findings are never consensus, and under the gate's default rule only a critical one blocks Claude from stopping. Keep the full panel of several vendors for the review before a pull request: see agreement between vendors.
To run another recipe:
- In the repository's Review settings, under Recipes, set Automatic reviews use. Default runs the repository's full panel, as these reviews ran before.
KENSA_REVIEW_GATE_RECIPE=ID, in the environment Claude Code runs in, names the review gate's recipe, for exampleKENSA_REVIEW_GATE_RECIPE=default.kensa init --git-hooks --recipe=ID --yeswrites a post-commit hook whose commit reviews run that recipe.
Both overrides win over the setting. A review a coding agent requests and kensa review --run are
unchanged: they run the recipe they name, or the repository's configuration.
Auto-Review on a schedule
Auto-Review reviews a repository's open pull requests on a schedule you set, and can publish the findings: see Configure automation and integrations. By default Auto-Review waits 60 minutes between two reviews of the same pull request. Its Changes only option reviews only what changed since the last review and carries forward the earlier findings on code the changes left alone; after a force push or a rebase it reviews the whole pull request. While a batch runs, a queued review whose pull request moved to a new head is replaced by a review of that head. Pull requests from untrusted contributors are skipped by default: see Reviewing a pull request you did not write.
The runaway guard
Coding agents on one computer can start at most 60 reviews in any rolling hour and 300 in any
rolling day. The guard counts every review that coding agents, kensa review --run, the review
gate and commit-review batches start, across all repositories. It is a fixed brake on an agent
caught in a loop, not a setting. When it is spent, Kensa refuses the request with cap-exhausted
and says when to retry. An earlier result Kensa reuses does not count. Reviews you start yourself in
Kensa Desktop, and scheduled Auto-Review, are not counted by it.
What is not built yet
- The review gate works only with Claude Code, and
kensa initwrites it only on macOS. - Kensa writes no post-commit hook on Windows.