Skip to main content

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:

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 maxStopPasses blocks (default: 5)
  • Auto-completion via Claude CLI sub-agent when available
  • Reviewer hard-cap via reviewerTimeoutSeconds (default: 600 seconds)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_auto_review-1.2.2.tar.gz (45.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_auto_review-1.2.2-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

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

Hashes for claude_auto_review-1.2.2.tar.gz
Algorithm Hash digest
SHA256 89bb3b1ac6c28d6ab2031331b1bd8f92e42c1008d2bf0a0738fc90ee60adc68a
MD5 3d534241db03228ef1a2e6f4a74865a5
BLAKE2b-256 332bcb045dd3833d08f4ab720dee842ab38dd56f3b64e4e32bb0d868202f5546

See more details on using hashes here.

File details

Details for the file claude_auto_review-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_auto_review-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a64c8db70faaa1c021f1b9b74598e26d5ad6558678da0dd9e9ed3eed938db410
MD5 9e0d17b39d1530822e154b14cac2660c
BLAKE2b-256 c0a006f2278b7a5b90d74015cb14ae66bf2110002d3635d4b2fb76197ae0093e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page