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.
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.
src/auth/session.ts
if (!session || isExpired(session)) { await store.delete(`session:${id}`); return undefined; } return session;} export async function endSession(store: Store, id: string): Promise<void> { await store.delete(`session:${id}`);} // A session ends TTL_SECONDS after it was created.export function isExpired(session: Session): boolean { return session.expiresAt < Date.now();}Every session is treated as expired
return session.expiresAt < Date.now();
verified · #b7d6c863
src/auth/session.ts
// A session ends TTL_SECONDS after it was created.export function isExpired( session: Session): boolean { return session.expiresAt < Date.now();}Every session is treated as expired
return session.expiresAt < Date.now();
verified · #b7d6c863
Example run · pull request #812 · recorded with the real ocra CLI and a scripted model
How it works
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
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
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
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
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
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.
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.
Out of scope for every reviewer. Reporting nothing is a valid outcome.
The example run: 4 candidate findings, 1 reported
Works where you work
Pull requests on GitHub, merge requests on GitLab, or any local branch. The same finding lands in each, on the line it quotes.
--prsummary comment + inline comments
ocra review · Significant concerns
src/auth/session.ts
line 42
Every session is treated as expired
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
--mrsummary note + inline threads
ocra review · Significant concerns
thread on src/auth/session.ts
line 42
Every session is treated as expired
Resolve threadReply…
Illustration
--from maina report in your terminal
src/auth/session.ts
L42
Example run · recorded
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
Tokens and dollars per task, helpers included. Set maxCostUsd and a run stops near that limit, keeping what it found.
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.
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
| task | input | cost |
|---|---|---|
| correctness-1 · auth code | 121,766 | $0.2045 |
| security-1 · auth code | 98,410 | $0.1627 |
| performance-1 · auth code | 61,208 | $0.0981 |
| correctness-2 · docs | 18,342 | $0.0214 |
| grouping, verification ×2, judgehelper calls ×4 | 16,210 | $0.0267 |
Run total: $0.5134
One finding, after you push
src/auth/session.ts
// A session ends TTL_SECONDS after it was created.export function isExpired(session: Session): boolean { return session.expiresAt < Date.now();}src/auth/session.ts
// A session ends TTL_SECONDS after it was created.export function isExpired(session: Session): boolean { return session.expiresAt * 1000 < Date.now();}Every session is treated as expired
src/auth/session.ts:42
threadresolved by ocra
IllustrationThe example run's finding after a push. These pushes are not in the recording.
Security
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.
Paths the gate refuses, each with its rule:
read_file(".env")gateAccess to .env is not allowed**/.envsecret pattern · the refusal, verbatim**/*.pemsecret pattern**/id_rsa*secret pattern.gitgit internals, any segmentAlso 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.
Everything from the change is neutralized before it enters a prompt; control characters never reach your terminal.
Enforced in packages/
For pull requests no plugin, install script, repository tool or build executes. Forks run behind a gated workflow.
Enforced in docs/
Files that look like secrets are refused at the gate. Keys never appear in logs, prompts, reports or session files.
Enforced in packages/
Argument arrays, no shell, and only the environment variables a child process needs.
Enforced in packages/
Agents are isolated, 30 steps each. Every OpenCode built-in is off: bash edit write webfetch and 10 more.
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.
available now
FreeApache-2.0
early access
Freebring your own key
ocra login from any machineplanned
Laterpricing not set
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.
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.
src/auth/session.ts
export function isExpired(session: Session): boolean { return session.expiresAt * 1000 < Date.now();}Install the CLI
npm install -g @open-cr-agent/cli
Node 22.19+
acme-api · pull request #812example run