Skip to main content

agenthook

Declarative agent hooks manager.

Overview

Lint hook for agentic coding (currently Claude Code only). Runs fix commands sequentially, then check commands in parallel, and blocks the edit on failure.

Requirements

Setup

.claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|MultiEdit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "uvx agenthook",
            "timeout": 45
          }
        ]
      }
    ]
  }
}

See agenthook.example.yml for all available configuration options.

How it works

  1. Claude Code triggers the hook after each file edit (git-ignored files are skipped)
  2. Fix commands run sequentially (formatting, auto-fix)
  3. Check commands run in parallel (linting, type checking)
  4. On failure, the edit is blocked with a report describing the issues

Development

just setup-dev

Tooling

Dependencies

Automated via Renovate. Dependency update PRs are created automatically.

Release

Automated via release-please. Merge the auto-generated Release PR to bump version, update CHANGELOG.md, and create a tag.

Release files for agenthook 0.0.2

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

Source distribution (sdist)

Source distribution for agenthook 0.0.2
File Size Uploaded
agenthook-0.0.2.tar.gz 91.5 kB Details

Built distribution (wheel)

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

Total release size: 113.9 kB

Release files / agenthook-0.0.2.tar.gz

Download URL agenthook-0.0.2.tar.gz
Size 91.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9dcee5dcd85c22c0f42c8ad522bdcfc051e5077ca28c758c52d6d9f5541434b4
BLAKE2b-256 checksum
How to use checksums
721800b418988095141f1bb5629b2518d12db8a6181473f3faa8faec7ed636ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / agenthook-0.0.2-py3-none-any.whl

Download URL agenthook-0.0.2-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
095633a9816028d8659fc6556584ab19a1161d0c87003053828c54c48d4b6b45
BLAKE2b-256 checksum
How to use checksums
3a20f6257d0b76a991d0a99b22ae33db7fc696f63f15477805ce8ea8ff98ebc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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