Claude Code plugin for automatic review after Claude edits files
Project description
Claude Auto Review
Claude Code plugin for automatic review after Claude edits files.
After each file edit (Write/Edit/MultiEdit/Delete), the plugin tracks the file hash. When Claude tries to stop, the plugin blocks until the changes have been reviewed — either manually in-session or automatically via Claude CLI sub-agent.
Architecture
The implementation is split into small modules instead of one monolith:
flowchart TD
A[Claude edits file] --> B[PostToolUse hook]
B --> C[Track file hash in client state]
C --> D[Claude attempts stop]
D --> E[Stop hook runs run_stop_flow]
E --> F{Unreviewed files?}
F -- No --> G[Allow stop]
F -- Yes --> H[Classify last assistant message]
H --> I{Classifier says incomplete?}
I -- Yes --> G
I -- No --> J{Pending review exists?}
J -- Yes --> K[Reuse pending review]
J -- No --> L[Run review prompt script]
L --> M{Review generation succeeded?}
M -- No --> N[Block stop]
M -- Yes --> O{Would stop be blocked?}
K --> O
O -- No --> G
O -- Yes --> N
N --> P[Return blocked stop response]
The classifier now runs before pending-review resolution on unreviewed stop paths: incomplete lets Claude continue working without invoking review generation, while complete, unknown, error, and skipped continue into the normal review/block flow.
The stop flow reads the current client state into a snapshot once per stop attempt so lifecycle queries share one view of the session.
State events are written through a single semantic append path so the per-client state.jsonl log and the project-level lifecycle log stay aligned.
Related Projects
This plugin was inspired by:
- hamelsmu/claude-review-loop — a stop-hook-driven automated review loop that uses Claude Code lifecycle hooks to block stops until diffs are reviewed.
- NTCoding/claude-skillz/automatic-code-review — an automatic code review workflow built around session hooks, review rules, and tracked file changes.
Thanks to both projects for the ideas and patterns that influenced this plugin.
Installation
See INSTALL.md for full details.
# From this repo (pip editable install + one-time init):
git clone https://github.com/tudragon154203/claude-auto-review.git
cd claude-auto-review
pip install -e .
claude-auto-review install
The installer creates the local .claude/claude-auto-review/ runtime tree (with scripts/, agents/, clients/ subdirs; clients/*/reviews/ and clients/*/run/ created lazily per session), copies the default rules, configures .claude/settings.json, and updates .gitignore.
Quick Start
# Run tests
python -m unittest discover -s tests
Implementation
- Dependency-free Python (standard library only)
- Uses Claude Code PostToolUse, Stop, and SessionEnd hooks
- Client isolation per session via
CLAUDE_SESSION_ID - Circuit breaker after
maxStopPassesblocks (default: 5) - Auto-completion via Claude CLI sub-agent when available
- Reviewer hard-cap via
reviewerTimeoutSeconds(default: 600 seconds)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_auto_review-1.2.2.tar.gz.
File metadata
- Download URL: claude_auto_review-1.2.2.tar.gz
- Upload date:
- Size: 45.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89bb3b1ac6c28d6ab2031331b1bd8f92e42c1008d2bf0a0738fc90ee60adc68a
|
|
| MD5 |
3d534241db03228ef1a2e6f4a74865a5
|
|
| BLAKE2b-256 |
332bcb045dd3833d08f4ab720dee842ab38dd56f3b64e4e32bb0d868202f5546
|
File details
Details for the file claude_auto_review-1.2.2-py3-none-any.whl.
File metadata
- Download URL: claude_auto_review-1.2.2-py3-none-any.whl
- Upload date:
- Size: 68.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a64c8db70faaa1c021f1b9b74598e26d5ad6558678da0dd9e9ed3eed938db410
|
|
| MD5 |
9e0d17b39d1530822e154b14cac2660c
|
|
| BLAKE2b-256 |
c0a006f2278b7a5b90d74015cb14ae66bf2110002d3635d4b2fb76197ae0093e
|