Clawpatch — AI Code Review That Lands Fixes


What It Is

An automated code review CLI that maps a repo into semantic feature slices, reviews each slice with an LLM provider, persists findings, and can run an explicit fix loop for one finding at a time.

“Review code. Patch bugs. Land PRs.”

Status: Early CLI. Review/report/state are implemented. Patching exists behind clawpatch fix --finding <id> and requires manual review.


Workflow

clawpatch init      → sets up .clawpatch/ config
clawpatch map       → maps repo into feature slices
clawpatch review    → reviews slices with AI provider
clawpatch fix       → explicit fix loop for one finding
clawpatch open-pr   → commits patch and opens PR

Full command set

CommandPurpose
initCreate .clawpatch/, detect project basics
mapWrite feature records (semantic slices of codebase)
statusShow project info, dirty state, feature/finding counts
reviewReview pending or selected features
review --mode deslopifyReview only for provable slop cleanup
ciInit → map → review → write report → GitHub step summary
reportPrint or write markdown findings report
nextPrint the next actionable finding
show --finding <id>Inspect one finding with evidence
triage --finding <id> --status <status>Mark finding as false-positive, etc.
fix --finding <id>Run explicit fix loop for one finding
open-pr --patch <id>Commit attempt & open a GitHub PR
revalidate --finding <id>Re-check one finding
revalidate --all --status openRe-check all open findings
doctorCheck provider availability

Supported Providers

  • codex — local Codex CLI (default)
  • acpx — any ACP-compatible agent (Claude, Pi, Gemini, etc.)
  • claude — local Claude Code CLI
  • cursor — Cursor Agent CLI (experimental)
  • grok — local Grok Build CLI
  • opencode — local OpenCode CLI
  • pi — local Pi coding agent
  • mock / mock-fail — test providers

Provider calls use strict JSON schemas. Review is read-only; fix mode allows workspace writes.


Language/Framework Coverage

Maps 15+ ecosystems:

  • TypeScript/Node — npm bins, workspace packages, Next.js routes, React components
  • Go — packages, tests, imports as review context
  • Java/Kotlin — Gradle/Maven source groups, semantic roles (DI, ViewModels, controllers)
  • Android — entrypoints, data boundaries, external clients
  • C#/.NET.sln/.csproj projects, ASP.NET controllers, minimal APIs
  • Ruby — executables, RSpec/Minitest
  • Elixir — Mix/Phoenix, contexts, Ecto migrations, ExUnit
  • Rustsrc/main.rs, crates/, tests/
  • C/C++/CUDA — CMake targets, autotools, .cu/.cuh sources
  • Python — console scripts, pytest, Flask/FastAPI/Django routes
  • Swift — SwiftPM targets
  • PHP/Laravel — composer.json, routes, controllers, Eloquent models
  • Kotlin Android — UI entrypoints, ViewModels, DI

Safety Model

  • Review does not edit files
  • Fix is explicit, selected by finding ID, and refuses dirty worktree
  • No auto-commit/push — only via explicit open-pr command
  • Provider output parsed through strict schemas
  • Symlinks and generated output skipped during mapping

Install

pnpm add -g clawpatch
# or from source:
pnpm install && pnpm build && pnpm link --global