Skip to main content

Claude Code plugin for automatic review after Claude edits files

Project description

coverage

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.

# Install from PyPI
pip install claude-auto-review

# One-time init in your target project root
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.

After installation, future Claude Code sessions will work with claude-auto-review automatically.

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)
  • Settings are live-reloaded from .claude/settings.json — no restart needed

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.4.1.tar.gz (48.5 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.4.1-py3-none-any.whl (71.2 kB view details)

Uploaded Python 3

File details

Details for the file claude_auto_review-1.4.1.tar.gz.

File metadata

  • Download URL: claude_auto_review-1.4.1.tar.gz
  • Upload date:
  • Size: 48.5 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.4.1.tar.gz
Algorithm Hash digest
SHA256 d568d0931c487a35e7d72c083395b07874389fcce64437cc165787fa6a2795b9
MD5 787d12d5f67187cbee74bc1e71ca7939
BLAKE2b-256 611491ef5296b9bbd588ca8d697dde601bc6d49a8662bfadcd8d5a5a1c43b290

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for claude_auto_review-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 66573d5211f2d0028e7fa4d25ed38ba2a82c69afd5f6584a1d99d0098a752d64
MD5 7761276440435257b50494d86366da08
BLAKE2b-256 c02404d50fc642a67405080286349017b4e49640a0511fba6e61ee5b3a8a7849

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