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 a reviewer CLI backend.

Features

  • Tracks file edits through Claude Code hooks and blocks stop until changes are reviewed.
  • Supports reviewer CLI backends via reviewerBackend (claude or codex).
  • Uses a last-message classifier to skip review generation when Claude should keep working.
  • Enforces a stop circuit breaker with maxStopPasses.
  • Live-reloads .claude/settings.json without a restart.

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 --> Q[Continue working without review generation]
    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 or Codex CLI reviewer backend when available
  • Reviewer hard-cap via reviewerTimeoutSeconds (default: 600 seconds)
  • Reviewer backend selection via reviewerBackend (claude or codex) with backend-specific default reviewer models
  • 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.8.1.tar.gz (54.6 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.8.1-py3-none-any.whl (81.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: claude_auto_review-1.8.1.tar.gz
  • Upload date:
  • Size: 54.6 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.8.1.tar.gz
Algorithm Hash digest
SHA256 719ad1e32d3fc76a15427008bc547af76a0dbfb94bc3cab94b869ebee89a16fd
MD5 e884029f0a1c287ebac96d77ff3d6b56
BLAKE2b-256 c2f4580349565b218bf202463b7df69c40d3e83ffbff2f9eed29cbd8e90c8d07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for claude_auto_review-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac15672f41377cd2ec9bb82ea70089063b103e3ea85ed0c4af703b76708bdf87
MD5 3cd50ebc158fc5764592ac113cc4f601
BLAKE2b-256 cddd39abaa4c8514a295d7b8f1df7b66e53f9ff9aa2ac8ebeb1505f8fc31d577

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