Skip to main content

Statutor

Keep project rules, handoffs, and decisions intact across coding-agent sessions.

CI status PyPI version MIT license

Quickstart · Agents · The ledger · Documentation

Statutor gives a repository a small set of files for its rules, current work, and decision history. Hooks check supported tool calls before they write. The Git check validates the staged result against the committed policy.

Append a new decision         → allowed
Rewrite an earlier decision  → blocked
Edit an ordinary source file → allowed

Quickstart

Install and initialize

Requires Python 3.10 or later. Run these commands in your project directory:

pipx install statutor
statutor init .

Existing files stay unchanged. init creates the ledger and detects a small project profile. Use statutor init . --type none for governed files only. Profiles and policy.

Choose your agent

Connect an adapter to check supported tool calls during a session. Installing the CLI and initializing a ledger do not register agent hooks.

Agent In-loop checks Setup
Claude Code File edits, shell, and patches Plugin commands below
Codex CLI Shell and patches Guide
OpenCode File edits, shell, and patches Guide
Google Antigravity File edits, batch edits, and shell Guide
Grok Build File edits and shell Guide
Cursor File edits, shell, and MCP when mapped Guide
Custom agents Checks through the CLI or Python API API and architecture

Claude Code

Run these slash commands inside Claude Code:

/plugin marketplace add https://github.com/hoohugokim/statutor
/plugin install statutor@hoo-plugins --scope project

The repository is the plugin. It includes /statutor-init, /handoff, /decide, and /statutor-doctor.

Enable the Git backstop

Hooks cover different tools on each agent. Use the staged-index check in addition to your agent adapter. With pre-commit installed, add this entry to your project's .pre-commit-config.yaml:

repos:
  - repo: https://github.com/hoohugokim/statutor
    rev: v0.7.5
    hooks: [{id: statutor}]

Then install the Git hook and check the ledger:

pre-commit install
statutor-doctor .

Run statutor staged . to check the current index directly. A native Rust binary provides the same staged checks without Python. Git setup and limits.

How the ledger works

Each file has a designated writer and a mutation policy. Four planes separate rules, current state, decisions, and plans:

Plane Default files Rule
Constitution AGENTS.md Human-owned rules, capped at 200 lines
State HANDOFF.md, TASKS.md Bounded handoff; stable task IDs
Log DECISIONS.md Append new decisions; preserve earlier entries
Plan ROADMAP.md, plans/ Archived plans are frozen

The default handoff is limited to 40 lines. Task checkboxes, descriptions, and ordering can change; existing IDs remain. CLAUDE.md bridges to AGENTS.md. See policy and trust for writer roles, budgets, shell checks, and intentional policy changes.

Optional capabilities

  • Global instructions and skills: preview and manage shared instructions and skills across supported hosts. This is a separate opt-in operation from project initialization.
  • Worker provenance: record sessions and attributed handoffs. Automatic hooks prove attempts, never successful mutation, and record nothing by themselves.

Coverage and limits

Automatic adapters stay silent outside a repository explicitly marked by .statutor.yaml. Hook failures allow the session to continue. The staged floor fails closed on invalid policy or Git errors. It inspects the local index; Git hooks can be bypassed with --no-verify.

MCP tools and some partial-patch checks remain outside in-loop coverage. Use the Git backstop to check their staged results. Agent-specific guides above describe each adapter's scope and verified behavior.

Documentation

Policy and trust · Architecture and API · Global layer · Workers · Releasing · Release notes

For local development, run pip install -e ., pytest -q, and statutor-doctor .. The kernel has no third-party dependencies; PyYAML is optional. Architecture covers the source layout, validation modes, design references, and contribution checks.

Metadata

Release files for statutor 0.7.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statutor 0.7.5
File Size Uploaded Provenance Actions
statutor-0.7.5.tar.gz 69.2 kB With provenance Details for statutor-0.7.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for statutor 0.7.5
File Interpreter ABI Platform Actions
statutor-0.7.5-py3-none-any.whl Python 3 none any Details for statutor-0.7.5-py3-none-any.whl

Total release size: 142.5 kB

Release files / statutor-0.7.5.tar.gz

Download URL statutor-0.7.5.tar.gz
Size 69.2 kB
Tags Source
SHA-256 checksum
How to use checksums
94641476f8f609eb8fe0f63e92040fcbfa74de2b3db9e965ee549e38325e7033
BLAKE2b-256 checksum
How to use checksums
46a15e46e3fa335912520e2b3b8ac1333c462d76607e5b0bdf5260ae52a9e856
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / statutor-0.7.5-py3-none-any.whl

Download URL statutor-0.7.5-py3-none-any.whl
Size 73.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50e1416680259dce93a47f9ab817669ffd7805455faf533577bd9aa398c88ac5
BLAKE2b-256 checksum
How to use checksums
e21421fe26dfe79c83685bed6f4434c42080460627fb113ccdf557b0371a8943
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for statutor 0.7.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for statutor-0.7.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page