# Coderabbit Review Commit

> Review exactly one commit with the CodeRabbit CLI in an isolated throwaway worktree.

- Skill: `compozy/coderabbit-review-commit` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add compozy/coderabbit-review-commit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/compozy/coderabbit-review-commit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: compozy (https://skillmd.com/u/compozy)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/compozy/coderabbit-review-commit

---


# CodeRabbit Review of a Single Commit

Review **exactly one commit** — including a non-tip one — with the CodeRabbit CLI. The CLI only diffs `base → HEAD`, so this skill pins the target commit in a **throwaway git worktree** (detached `HEAD = C`) and reviews `base = C~1 → HEAD = C`. The current branch and working tree are never touched; the worktree is force-removed on every exit path.

## Procedure

**Step 1: Resolve the target commit**
1. Default to `HEAD~1` (the penultimate commit) unless the user names a commit-ish or SHA.
2. Confirm it resolves: `git rev-parse --short <target>`.

*Done when:* a concrete short SHA is in hand.

**Step 2: Run the review in the background**
1. Execute the bundled helper (**mutating:** creates a temp worktree + log file; never alters the branch), backgrounded — the review takes minutes:
   `bash <coderabbit-review-commit-dir>/scripts/review-commit.sh <target>`
2. The helper tees to `<repo>/.coderabbit/reviews/<short-sha>.log` and cleans its worktree on exit.
3. Override with env only when needed: `CR_REVIEW_OUT` (log dir), `CR_CONFIG` (config file), `CR_REVIEW_TYPE` (default `committed`).

*Done when:* the helper is running and its log path is reported.

**Step 3: Report the outcome**
1. On completion, surface the log path and the CodeRabbit findings.

*Done when:* the user has the findings and the log location.

## Error Handling
- `coderabbit` not in PATH → helper exits 127; the user must install and auth the CLI (`coderabbit auth login`).
- Target is a root commit (no parent) → helper exits 1; there is no base to diff.
- `Too many files!` (commit exceeds CodeRabbit's 300-file cap) → review a subdirectory (`coderabbit review --dir <path>`) or split the commit.

