/baz:review [committed|uncommitted] [--base <branch>] [--pr <number|url>] [--include-untracked] [--fix]from baz
Reviews code changes using Baz indexed search and org review guidelines. Checks diffs against other repos and configured standards, not just local files. Supports committed/uncommitted/--base/--pr scopes with optional --fix loop.
Ships in baz. 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.
Review a set of changes and report what is actually wrong with them. $ARGUMENTS carries the scope flags (all optional).
Two things make this review different from reading the diff yourself:
Reviewing is read-only. Do not edit files, amend commits, or push. The one exception is the --fix loop in Step 7, which runs only after the user approves specific findings.
Parse $ARGUMENTS, then build the diff.
Resolve the base branch first, and confirm the ref actually resolves before you diff against it — --base <branch> overrides all of this. Walk the ladder in order, taking the first that resolves under git rev-parse --verify:
git symbolic-ref refs/remotes/origin/HEAD — the remote's declared default. Commonly absent in a fresh or CI clone; that is expected, fall through.origin/main, then origin/master.main, then master (local branches, for a repo with no remote).--single-branch clone, where the base branch simply isn't in the object store. Do not diff against HEAD~1 and hope. Run git fetch --depth=100 origin <branch> to pull the base in, or ask the user which base to use. Say which one you did.Never assume main exists because the repo looks like it should have one — rev-parse --verify it. Diffing against a ref that doesn't resolve produces a git error mid-review; diffing against the wrong ref silently reviews the wrong changes, which is worse.
| Argument | What to review | How to get it |
|---|---|---|
| (none) | Everything not yet on the base branch — commits on this branch plus uncommitted tracked edits | git diff $(git merge-base <base> HEAD) |
committed | Only commits on this branch | git diff <base>...HEAD |
uncommitted | Only staged + unstaged edits to tracked files | git diff HEAD |
--include-untracked | Adds new files git isn't tracking yet | git ls-files --others --exclude-standard, then read each |
--pr <number|url> | An open pull request | gh pr diff <n> (or glab mr diff <n>) |
Scope flags can contradict each other, and guessing wrong means reviewing a different diff than the user asked for. Resolve combinations by this ladder, top rule first:
--pr is exclusive. Combined with committed, uncommitted, --include-untracked, or --base, stop and ask which they meant. Do not guess — a PR's diff against its own base and the local branch's diff can differ substantially, and silently picking one produces a confident review of the wrong changes.committed + uncommitted together == the default scope, since the default is exactly their union (merge-base → working tree). Proceed, and say that's how you read it.--include-untracked + committed is contradictory — a committed range cannot contain untracked files. Stop and ask.--include-untracked is additive to the default and to uncommitted. Valid, no conflict.--base is inert with uncommitted, which diffs against HEAD and never consults a base. Honour the uncommitted scope and say the --base value had no effect — don't drop it silently.--fix is orthogonal and combines with every scope.Never silently ignore a flag the user typed. Anything refused or inert must appear in the scope line below.
Notes:
--pr needs gh/glab on PATH and authenticated. If it isn't, say so and offer the branch-based scopes instead — don't fall back silently to a different diff than the user asked for.--name-status first, then pull the diff. If the diff is very large, review it in file batches rather than truncating — a truncated diff produces a review that silently skips files, which is worse than a slower one.State the resolved scope in one line before reviewing — the scope mode you settled on, base branch, number of files, number of commits, plus any flag you refused or treated as inert and why — so the user can see immediately if you're looking at the wrong thing.
Read the changed files around the hunks. A diff hides the calling context, the early return above it, the lock that's already held. Most false findings come from reviewing hunks in isolation.
Do not report anything until you can name the concrete conditions that trigger it.
The org configures its reviewers in Baz — Baz's built-in ones plus any custom ones the org wrote. mcp__baz__organizational_review_guidelines returns them live. Review against those, not against your own defaults. They are the same standards a Baz review of this PR would apply, and most of their content is calibration: what this org wants flagged, and what it has decided is not worth flagging.
mcp__baz__organizational_review_guidelines(repository: "<basename of `git rev-parse --show-toplevel`>", page: 1, pageSize: 5)
repository is the directory name at the repo root (baz-plugin, not baz-scm/baz-plugin and not a path). This is not an indexed search and does not count against the baz-codebase-exploration search budget — Step 4 still gets its full ten calls.
guidelines text can run thousands of words, and an org can have a dozen reviewers. Page through with pageSize: 5 and keep going until pagination.hasMore is false — filter each page as it arrives (below) and keep only what applies, but never stop paging early. The reviewer that matters for this diff can sit on the last page, and a run that stopped at page one would silently review against a subset of the org's standards.globPatternsToReview / globPatternsToSkip. For each reviewer, work out which changed files it covers: those matching its review globs and not excluded by its skip globs. An empty globPatternsToReview means the whole repo. Drop a reviewer with no matching files, and for the rest carry the matching file list forward — a reviewer's rules bind only on the files in its own subset, in both directions. Applying one reviewer's criteria to the whole diff because one file matched produces off-target findings; applying its suppressions that widely hides real ones.read_agent_file), skip that criterion and say so in the Coverage line rather than substituting a guess.If the tool is missing, unauthenticated, or errors, say so in one line and review against the Step 5 categories alone. Unlike the cross-repo checks, missing guidelines do not block the merge verdict — they change how the review is calibrated, not whether it can see the consumers. Report it in Coverage either way.
Load and follow the baz-codebase-exploration skill (Skill tool on Claude Code; already an always-on rule on Cursor). It owns tool routing, the search budget, and the verify-before-you-assert rule; everything below is what to point those tools at during a review. As there, all searching goes through Baz — repo_search, remote_grep, remote_file_search — never a shell walk of another repo.
Pass the session-correlation arguments on every Baz call — sessionId, sessionRepository, and agentVendor, exactly as the SessionStart context gave them to you. Pass whichever of the three that context actually supplied. The hook omits sessionRepository when the cwd has no resolvable origin remote, and agentVendor when the harness didn't supply one; the values are not yours to invent, so don't substitute a guess from the folder name. A missing value costs session correlation in Baz — it does not invalidate the search results, so it is never a reason to skip the cross-repo checks or to downgrade the review's coverage. Coverage is gated on the checks not running (below), not on telemetry fields.
This step is not optional garnish. Before running the checks, confirm the Baz tools are actually callable: mcp__baz__repo_search and friends present in your tool list (Claude Code may list them as mcp__plugin_baz_baz__repo_search and so on — same tools, and the same prefix applies to every baz tool this skill names), and your first call not failing with an auth error. If they are missing or unauthenticated, you must not quietly fall back to a local-only review — that produces a review that looks complete while skipping the only checks that can see other repos.
When Baz is unavailable, first decide whether the diff has an outward-facing surface: a changed or removed exported signature, an altered response/request shape, a renamed event or topic, a schema or DB column change, a new or removed public export, an enum or dispatch set another repo may switch on, a changed config or API contract.
/mcp on Claude Code shows connection state) and offer to re-run. If they want the local-only review anyway, give it — clearly labelled incomplete, with no safe-to-merge claim.The same rule applies if Baz is connected but you exhaust the search budget before finishing check 1: say which symbols went unchecked rather than implying full coverage.
Run these checks in priority order, and stop when the search budget (10 calls) is spent:
remote_grep the identifier across the org and read the hits. A call site that still passes the old shape is a blocking finding, and it is one this review is uniquely able to find. Say which repo and file it lives in.repo_search/remote_grep will surface it. Report it only when the existing helper is a genuine drop-in — a speculative "maybe there's a util for this" is noise.If the diff is purely local (formatting, a private helper, a test-only edit) with no outward-facing surface, skip this step and say you skipped it. Burning ten searches on a rename that touches nothing is worse than not searching.
Work the applicable reviewers from Step 3 first — those are this org's standards, and a violation of one is a finding the org has already said it wants. Apply each reviewer only to the files in its matching subset from Step 3; a file outside that subset is reviewed under the other applicable reviewers and the categories below, never under this one. Then, and on top of them, look for:
null/empty/error returns, wrong operator precedence.A guideline finding is held to the same bar as any other: name the changed code, the specific rule it breaks, and the concrete consequence. Before reporting or suppressing on a guideline, confirm the file it points at is inside that reviewer's subset. Attribute it to the reviewer it came from — per **<reviewer title>** — so the user can see which standard is speaking, and cite the guideline's own wording rather than paraphrasing it into something stronger.
What not to report. Style, formatting, naming preferences, and speculative "consider extracting this" refactors are noise unless they cause a defect. Do not report pre-existing problems the diff didn't introduce or touch. Do not report something you could not verify by reading the source — verify or drop it. And anything an applicable guideline tells you not to flag stays unreported — a suppression in the org's own config beats your default instinct, at every severity.
Group findings by severity, most severe first. Every finding needs a file:line, the concrete conditions under which it fails, and a fix. Cross-repo findings name the other repo.
## Review — <scope, base branch, N files>
### Blocking
1. **<one-line claim>** — `<repo?> · <path>:<line>` <per **<reviewer title>**, when the finding comes from a guideline>
Fails when: <concrete inputs or state → wrong result, crash, or breach>
Fix: <what to change>
### Should fix
...
### Consider
...
## Coverage
Cross-repo checks: <ran, and which repos searched clean | NOT RUN — Baz unavailable | partial — budget exhausted, <symbols> unchecked>
Org guidelines: <applied: <reviewer titles> | none applicable to the changed paths | NOT LOADED — <reason>> <plus any criterion skipped for a missing tool>
## Summary
<N blocking, N should-fix, N consider.> <One line: is this safe to merge?>
Emit every heading in order; write _None._ under any that are empty. If there is nothing to report, say the change looks correct and name what you checked — including which repos you searched and found clean. A clean review that lists its coverage is useful; a bare "LGTM" isn't.
Never state or imply a change is safe to merge when the cross-repo checks did not run and the diff has an outward-facing surface. That is the one claim this review cannot make on local information alone — the whole point of Step 4 is that a signature change looks fine in this repo right up until it breaks a caller in another one. Say "no issues found in this repo, cross-repo consumers unchecked" and leave the merge decision to the user.
--fix, or when the user asks)Turn the findings into a task list — one task per finding, blocking first — and show it before touching anything. Then work through it:
Finish with what was fixed, what was skipped and why, and what still needs a human.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub baz-scm/baz-plugin --plugin baz4 skills in this plugin
/baz-codebase-explorationProcedure for exploring repositories with Baz's indexed search tools. Use when asked to plan a feature, design a change, scope work, or investigate where to make changes across the org's repos. Applies even when you own one side of a cross-repo contract (API param, schema, event payload) locally, and especially when the relevant repositories are not checked out locally. Baz's MCP tools are how you search code across the org; once you know a file's path, read it however you like.
/get-plan-commentsPull the comments teammates left on a Baz plan back into this session, summarize every one of them with an assessment and a recommendation, and — only after you choose — apply the ones you pick and reply on them. Invoke with /baz:get-plan-comments.
/plan-with-bazPlan a feature or change end-to-end using Baz indexed search across your org's repos. Explores the relevant repos with Baz's MCP tools and produces a structured implementation plan the user signs off on before any code is written. Invoke with /baz:plan-with-baz when you want to start planning a piece of work.
Other plugins' skills for the same job