Reads first. Comments last.

Open-source AI code review for GitHub and GitLab. It stays quiet unless a finding quotes the code it means and holds up on a second read.

Free during early access. Bring your own model key.

Example run · pull request #812 · recorded with the real ocra CLI and a scripted model

How it works

A model answers. Code checks the answer.

Selection, bundling, anchoring and the verdict are tested code. A model is asked to group files, review, verify and judge, and every answer is checked against a schema before it moves on.

selecttriage

Only the files worth reading

Binaries, lock files, generated code and likely secrets are set aside, each with a recorded reason. Sensitive paths such as auth/ or CI workflows make the change full tier.

bundlematrix

One task per group and reviewer

A light model groups files that belong together. Correctness always runs; security and performance skip docs and tests. --plan lists every task before a model is paid.

reviewanchor

Findings quote the code they mean

An isolated agent reads the exact revision with read-only tools and stops after 30 steps. It quotes the code; ocra finds the quote in the diff and pins the comment there. The model never picks the line.

filterverifyjudgeverdict

Only what holds up on a second read

A verifier drops what the code disproves. A judge merges the same root cause, but can never drop a confirmed critical. The verdict is computed in code.

commentusage

One comment, and the bill

The finding lands on the line it quotes, with the fix it suggests. Tokens and dollars are counted for every model call, helpers included.

code, deterministicmodel, judgment

Example run · ocra review --from main · pull request #812

In the example run 5 files changed. package-lock.json was set aside as generated; docs/auth.md was read for correctness only; src/api/login.ts, src/auth/token.ts and src/auth/session.ts were read as auth code, at full tier.

2 bundles gave 4 tasks: correctness-1, security-1, performance-1, correctness-2.

The agents reported 4 candidate findings. "Every session is treated as expired" quoted line 42 of src/auth/session.ts and was confirmed as critical; "Expiry compares seconds with milliseconds" was merged into it; "user may be undefined" matched the repository's memory and was not reported; "Token stays valid after logout" was disproved by the code.

The run made 8 model calls: 315,936 input tokens, 209,152 of them cached, 9,021 output and 8,489 reasoning tokens, $0.5134 in total.

Quiet by design.

A reviewer that comments on everything gets ignored. ocra stays quiet unless it can quote the code, say what it checked, and survive a second read.

  • Style
  • Speculation
  • Unchanged code

Out of scope for every reviewer. Reporting nothing is a valid outcome.

The example run: 4 candidate findings, 1 reported

Works where you work

Reviews where you work, on the model you pay for.

Pull requests on GitHub, merge requests on GitLab, or any local branch. The same finding lands in each, on the line it quotes.

GitHub

--pr

summary comment + inline comments

ocra review · Significant concerns

posted as github-actions[bot]

src/auth/session.ts

line 42

Every session is treated as expired

critical · verified · correctness

isExpired() compares expiresAt, stored in seconds, with Date.now() in milliseconds, so it is always true: loadSession() deletes every session and users are logged out right after signing in.

Suggestion: return session.expiresAt * 1000 < Date.now();

Example run

GitLab

--mr

summary note + inline threads

ocra review · Significant concerns

one note, updated in place

thread on src/auth/session.ts

line 42

Every session is treated as expired

critical · verified · correctness

Resolve threadReply…

Illustration

Local branches

--from main

a report in your terminal

$ ocra review --from main⋮Verdict: significant concerns

src/auth/session.ts

L42

critical L42 Every session istreated as expired [verified] #b7d6c863⋮1 finding(s) (1 critical, 0 warning, 0suggestion) · tokens: 315936 in (209152cached), 9021 out, 8489 reasoning ·$0.5134

Example run · recorded

45model providers through ocra Cloud

openai · anthropic · openrouter · gemini · deepseek · mistral · groq · xai · together · fireworks · cerebras · moonshot · moonshot-cn · kimi-coding · zai · zhipu · qwen · qwen-cn · minimax · minimax-cn · siliconflow · siliconflow-cn · volcengine · qianfan · hunyuan · stepfun · baichuan · longcat · huggingface · cohere · vercel · deepinfra · perplexity · venice · novita · nebius · sambanova · inference-net · chutes · upstage · ai21 · ionos · scaleway · featherless · opencode-zen

Store a key for any of them in ocra Cloud, or point ocra at any OpenAI-compatible endpoint you run.

Features

You set the limits.

  1. Every attempt shows its bill

    Tokens and dollars per task, helpers included. Set maxCostUsd and a run stops near that limit, keeping what it found.

  2. Your team's rules, without writing a plugin

    Put review rules in .ocra/rules.json on the base branch. For local reviews, plugins can add rules, reviewers, tools and listeners through one small contract.

  3. When a model falls over, the next takes the task

    Each tier can list several models. Overloads move on; a model out of quota is dropped for the rest of the run.

acme-api · pull request #812example run

$ ocra review --from main

What this review cost, task by task
taskinputcost
correctness-1 · auth code121,766$0.2045
security-1 · auth code98,410$0.1627
performance-1 · auth code61,208$0.0981
correctness-2 · docs18,342$0.0214
grouping, verification ×2, judgehelper calls ×416,210$0.0267

Run total: $0.5134

tokens 315,936 in (209,152 cached)9,021 out · 8,489 reasoningThis example run's bill, not a typical one.

One finding, after you push

It follows the code.

  1. OpenIts code is unchanged, so it stays open on the next push, even if no reviewer reports it again.
  2. FixedThe quoted line is gone from the file, so ocra resolves the thread. That is the only evidence it takes.
  3. DismissedA maintainer declined it, so ocra stops reporting it unless it returns more severe. The author cannot.

IllustrationThe example run's finding after a push. These pushes are not in the recording.

Security

Built for code you do not trust.

A diff, a pull request title, an AGENTS.md: anything in the change can be written by an attacker. ocra assumes it is, and publishes its threat model with the code.

Refused at the gate. One gate, in core, for every agent and every adapter.

Paths the gate refuses, each with its rule:

  • .envagentread_file(".env")gateAccess to .env is not allowed**/.envsecret pattern · the refusal, verbatim
  • *.pem**/*.pemsecret pattern
  • id_rsa**/id_rsa*secret pattern
  • .git/.gitgit internals, any segment

Also refused .npmrc .netrc *.key id_ed25519 .aws/credentials .kube/config *.tfstate credentials.json and the rest of the secret patterns, and anything outside the repository.

Nothing from the reviewed tree runs

For pull requests no plugin, install script, repository tool or build executes. Forks run behind a gated workflow.

Enforced in docs/adr/0013-fork-pull-requests.md

Secrets never leave

Files that look like secrets are refused at the gate. Keys never appear in logs, prompts, reports or session files.

Enforced in packages/core/src/select/patterns.ts

Least privilege for processes

Argument arrays, no shell, and only the environment variables a child process needs.

Enforced in packages/vcs-local/src/git.ts

Agents are isolated, 30 steps each. Every OpenCode built-in is off: bash edit write webfetch and 10 more.

Open core. Hosted when you want it.

The engine stays Apache-2.0 and complete without an account. ocra Cloud is free while it is in early access; you bring the model key.

  1. available now

    Self-hosted

    FreeApache-2.0

    • CLI, GitHub Action, GitLab, container image
    • Your runner and your model key
    • Only your model provider sees the code
    • Your own rules, reviewers and plugins
  2. early access

    ocra Cloud

    Freebring your own key

    • Sign in with GitHub; ocra login from any machine
    • Keys for 45 providers, encrypted, checked on save where the provider allows
    • Usage, spend and review counts by day
    • Default models chosen once, on the web
  3. planned

    Team

    Laterpricing not set

    • A hosted GitHub App: no workflow, no secrets
    • Organizations with shared rules and policy
    • Models provided by ocra, no key needed
    • Review history per repository

With ocra Cloud your change passes through its gateway on the way to your model provider, and the console keeps counts by default; findings and the code they quote only if you turn on findings sharing. If nothing but your provider may see the code, self-host: it is the same engine.

Questions, answered plainly.

More answers in the manual

The engine, the CLI and the GitHub Action are Apache-2.0 and need no account. You pay your model provider for the tokens a review uses, and every run prints its cost. ocra Cloud is free during early access.

Self-hosted, only your model provider: the change with its title and description, your AGENTS.md and review rules, and what the agents open or search in the repository. Never files that look like secrets, or anything outside the repository. With ocra Cloud the request also passes through its gateway.

Any of 45 providers through ocra Cloud, any model OpenCode supports, or your own OpenAI-compatible endpoint with a price per model. Each tier can list several models; when one falls over, the next takes the task.

Yes: merge requests on GitLab.com or self-managed, with the same inline comments, summary and incremental re-reviews as on GitHub.

It is built not to. Findings are verified against the code and merged by root cause, and the verdict only blocks on a critical the verifier confirmed. A run with nothing worth saying posts no inline comment, only its one summary, updated in place.

Results on a golden set and AACR-Bench are published in the manual with their limits: a small sample on two model families, with recall the weak point we are working on.

Point it at a pull request you already know.

src/auth/session.tssuggested fix · line 42

    1. export function isExpired(session: Session): boolean {
    2. return session.expiresAt * 1000 < Date.now();
    3. }

    Install the CLI

    npm install -g @open-cr-agent/cli

    Node 22.19+

    acme-api · pull request #812example run