Declarative agent hooks manager.
Project description
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
- Claude Code triggers the hook after each file edit (git-ignored files are skipped)
- Fix commands run sequentially (formatting, auto-fix)
- Check commands run in parallel (linting, type checking)
- On failure, the edit is blocked with a report describing the issues
Development
just setup-dev
Tooling
- Runtime: uv
- JS/TS: Biome
- Python: Ruff, ty, Poe, pytest
- Project template: Copier
- Task runner: just
- Git hooks: Lefthook
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agenthook-0.0.2.tar.gz.
File metadata
- Download URL: agenthook-0.0.2.tar.gz
- Upload date:
- Size: 91.5 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dcee5dcd85c22c0f42c8ad522bdcfc051e5077ca28c758c52d6d9f5541434b4
|
|
| MD5 |
777fa8d43d4776bcc47f0ad7f80eebbb
|
|
| BLAKE2b-256 |
721800b418988095141f1bb5629b2518d12db8a6181473f3faa8faec7ed636ec
|
File details
Details for the file agenthook-0.0.2-py3-none-any.whl.
File metadata
- Download URL: agenthook-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.4 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
095633a9816028d8659fc6556584ab19a1161d0c87003053828c54c48d4b6b45
|
|
| MD5 |
c70b824f361452ce3823bf21baa51d95
|
|
| BLAKE2b-256 |
3a20f6257d0b76a991d0a99b22ae33db7fc696f63f15477805ce8ea8ff98ebc4
|