Clawpatch — AI Code Review That Lands Fixes
- Repo: openclaw/clawpatch
- Stars: 723 ⭐
- Language: TypeScript
- License: MIT
- Homepage: clawpatch.ai
- Topics:
bot,review
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
| Command | Purpose |
|---|---|
init | Create .clawpatch/, detect project basics |
map | Write feature records (semantic slices of codebase) |
status | Show project info, dirty state, feature/finding counts |
review | Review pending or selected features |
review --mode deslopify | Review only for provable slop cleanup |
ci | Init → map → review → write report → GitHub step summary |
report | Print or write markdown findings report |
next | Print 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 open | Re-check all open findings |
doctor | Check provider availability |
Supported Providers
codex— local Codex CLI (default)acpx— any ACP-compatible agent (Claude, Pi, Gemini, etc.)claude— local Claude Code CLIcursor— Cursor Agent CLI (experimental)grok— local Grok Build CLIopencode— local OpenCode CLIpi— local Pi coding agentmock/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/.csprojprojects, ASP.NET controllers, minimal APIs - Ruby — executables, RSpec/Minitest
- Elixir — Mix/Phoenix, contexts, Ecto migrations, ExUnit
- Rust —
src/main.rs,crates/,tests/ - C/C++/CUDA — CMake targets, autotools,
.cu/.cuhsources - 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-prcommand - 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