hokum
Every CLI command already knows how to fail.
hokumexplains it to Claude Code properly.
hokum is a command-line tool that you can use to wrap any other CLI command as a Claude Code hook,
dealing with the quirky semantics around exit codes, stderr, and JSON.
What Problem Does This Solve ?
Claude Code hooks look like ordinary shell commands, but Claude Code talks to them through a surprise-laden protocol all of its own — and ordinary CLI tools don't speak it:
- Input arrives as JSON on stdin. The hook event (which tool ran, which file it
touched, and so on) is delivered as a JSON document, not as command-line arguments.
A tool like
ruff checkoreslintwants a file path in argv and has no use for a JSON blob. - Exit codes carry unusual meanings.
0is success.2means "block with an error if relevant for this hook, and feed stderr back to Claude". Anything else — including the exit code1that nearly every linter, formatter, and test runner uses to report findings — is a non-blocking error: the output is shown to the user, but Claude never sees it. - Output routing depends on the outcome. Only stderr, and only with exit code
2, reaches Claude as feedback. Ordinary tools print their findings to stdout or stderr as they please, and exit1when something's wrong.
Put together, the naive setup — "run my linter after every edit" — produces a hook
that fires, finds problems, exits 1, and is silently ignored. Everything looks
configured, but nothing actually happens.
hokum sits between Claude Code and your command and translates in both directions:
it extracts what the command needs from the event JSON, runs the command as the
normal CLI tool it is, and maps the result onto the exit codes and streams that
Claude Code actually respects.
Metadata
Release files for hokum 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hokum-0.5.tar.gz | 8.6 kB | With provenance | Details for hokum-0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hokum-0.5-py3-none-any.whl | Python 3 | none | any | Details for hokum-0.5-py3-none-any.whl |
Total release size: 17.7 kB
Release files / hokum-0.5.tar.gz
| Download URL | hokum-0.5.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
905b87e29a0bf7b78f8803dac802d2385e40fc37368a1cc0b6e46002aca44327
|
|
BLAKE2b-256 checksum How to use checksums |
670edeb7c5dbb726994b71312d2439b50e4601b439e5a6321be6c8fcbbef3830
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 16, 2026.
Transparency logRelease files / hokum-0.5-py3-none-any.whl
| Download URL | hokum-0.5-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
21de604f820e4da86e9763a288cbe28592dc6f109c0cd15978dc8dc244816355
|
|
BLAKE2b-256 checksum How to use checksums |
eda3f88c466b8a35c9ae76632891eae375c4394866ba6ca9669bded1b1e93d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Sep 16, 2026.
Transparency logSecurity for hokum 0.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.
Attestation for hokum-0.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 Sep 16, 2026.
Transparency logA 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.