/ckb:review [base-branch | staged | PR-number]from CKB · Code Knowledge Backend
Reviews a branch, staged changes, or PR using CKB's structural checks first, then reads only what CKB flags to minimize token usage.
Ships in CKB · Code Knowledge Backend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run a CKB-augmented code review optimized for minimal token usage.
$ARGUMENTS - Optional: base branch (default: main), or "staged" for staged changes, or a PR number
CKB already answered the structural questions (secrets? breaking? dead code? test gaps?). The LLM's job is ONLY what CKB can't do: semantic reasoning about correctness, design, and intent. Every source line you read costs tokens — read only what CKB says is risky.
CKB runs 15 deterministic checks with AST rules, SCIP index, and git history. It is structurally sound but semantically blind:
> vs >=), off-by-one, incorrect algorithmCKB's scoring uses per-check caps (max -20) and per-rule caps (max -10), so a score
of 85 can still hide multiple capped warnings. The score never drops below 20 (80
points of deductions in all), so 20 means "at least that bad". verdictReason says
which checks decided the verdict; a pass needs no warning finding and a score of 50.
limitations lists what the index can't see in this diff (members reached by a
computed key, obj[key]): read those lines yourself, the callers and tests above
leave them out. HoldTheLine only flags changed lines,
so pre-existing issues interacting with new code won't surface.
CKB already ran, before you read this, on what the skill's argument names: none for the current branch against main, "staged" for the staged changes, a branch name for that base, a PR number for that PR's base (and its branch if it is checked out):
!"${CLAUDE_PLUGIN_ROOT}/scripts/ckb" review --target='$ARGUMENTS' --compact || true
If that is an error instead of JSON (no CKB setup here, an unknown base branch,
gh missing for a PR number), fix the cause or run "${CLAUDE_PLUGIN_ROOT}/scripts/ckb" review --base=<branch>
or "${CLAUDE_PLUGIN_ROOT}/scripts/ckb" review --staged with --compact yourself, then go on.
A Note: line before the JSON says what was reviewed instead of the PR.
Parse the JSON output to extract:
score, verdict, verdictReason — overall quality and what decided itactiveChecks[] — name + status + summary of each check that warned or failed;
passedChecks[] — names of the checks that passedfindings[] — the 30 most important (blocking first, then by severity): check,
severity, file, line, message, ruleId; remainingFindings and
remainingBySeverity count the rest. For those, run the review yourself with
--format=json and read only the checks you needlimitations[] — what the review could not seenarrative — CKB AI-generated summary (if available)prTier — small/medium/largereviewEffort — estimated hours + complexityreviewers[] — suggested reviewers with expertise areashealth — degraded/improved file countsFrom the output, build three lists:
Early exit: Skip LLM ONLY when ALL conditions are met:
If ANY condition fails, proceed to Phase 2 — CKB's structural pass does NOT mean the code is semantically correct.
Do NOT read the full diff. Do NOT read every changed file.
For files CKB flagged (INVESTIGATE list):
Read only the changed hunks via git diff <base>...HEAD -- <file> (<base> as in
Phase 1, main by default), or git diff --cached -- <file> for staged changes.
For new files (CKB has no history — these are your biggest blind spot):
For each file you read, look for exactly:
Do NOT look for: style, naming, formatting, documentation, test coverage — CKB already checked these structurally.
## [APPROVE|REQUEST CHANGES|DISCUSS] — CKB score: [N]/100
[One sentence: what the PR does]
[If CKB provided narrative, include it here]
**PR tier:** [small/medium/large] | **Review effort:** [N]h ([complexity])
**Health:** [N] degraded, [N] improved
### Issues
1. **[must-fix|should-fix]** `file:line` — [issue in one sentence]
2. ...
### CKB passed (no review needed)
[comma-separated list of passed checks]
### CKB flagged (verified above)
[for each warn/fail finding: confirmed/false-positive + one-line reason]
### Suggested reviewers
[reviewer — expertise area]
If no issues found: just the header line + CKB passed list. Nothing else.
What SKILL.md sets; muted values are Claude Code's defaults
Reviewing a whole branch, the staged changes or a pull request: 'review my branch', 'review PR 123', 'is this ready to merge'. Not for one function, file or pasted snippet: invoking it runs ckb review over the whole diff first.
Three short reads, in order
npx claudepluginhub simplyliz/ckb --plugin ckb2 skills in this plugin
Other plugins' skills for the same job