OpenHook Protocol SDK — standardized hook payloads for AI coding agents
Project description
OpenHook
A lightweight protocol that standardizes hook payloads for AI coding agent tools.
Problem
Every AI coding tool (Claude Code, Cursor, Gemini CLI, GitHub Copilot, Kiro, etc.) implements its own hook format — different field names, event types, and configuration mechanisms. Hook consumers must write per-tool adapters with fragile heuristic detection.
Solution
OpenHook defines a self-describing JSON envelope. A single openhook field identifies conforming payloads, eliminating heuristic detection entirely.
{
"openhook": "0.1",
"id": "550e8400-e29b-41d4-a716-446655440000",
"source": "claude-code",
"type": "session.end",
"time": "2026-02-23T10:15:30.123Z",
"session_id": "sess_abc123",
"data": {
"transcript_path": "/path/to/session.jsonl"
}
}
Event Types
| Type | Required | Description |
|---|---|---|
session.end |
REQUIRED | Session ends. Minimum conformance. |
session.start |
OPTIONAL | Session begins. |
prompt.submit |
OPTIONAL | User submits a prompt. |
tool.start |
OPTIONAL | Agent starts using a tool. |
tool.end |
OPTIONAL | Agent finishes using a tool. |
SDKs
Python
pip install openhook
from openhook import OpenHookEvent, EventType, parse_stdin
# Consume hook events
event = parse_stdin()
print(event.source, event.type, event.transcript_path)
# Produce hook events
event = OpenHookEvent.create(
source="my-tool",
type=EventType.SESSION_END,
session_id="sess_123",
)
event.emit()
TypeScript
npm install @openhook/sdk
import { parseStdin, OpenHookEvent, EventType } from '@openhook/sdk';
const event = await parseStdin();
console.log(event.source, event.type, event.transcriptPath);
Specification
See spec/openhook-0.1.md for the full protocol specification.
License
Apache-2.0
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 openhook-0.1.0.tar.gz.
File metadata
- Download URL: openhook-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40bc145ac6043cf1a19f2bb2d7ce59d6af1d472f2657a20fc1dbc3016d493e57
|
|
| MD5 |
dab50a1e139d2fc8af79421c8e7874cd
|
|
| BLAKE2b-256 |
95b5c5c0bc2c88d5145ba37d1aaf8ace74fe6323d5b2fa0fe556af183d1798ec
|
Provenance
The following attestation bundles were made for openhook-0.1.0.tar.gz:
Publisher:
publish-python.yml on HikaruEgashira/open-hook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openhook-0.1.0.tar.gz -
Subject digest:
40bc145ac6043cf1a19f2bb2d7ce59d6af1d472f2657a20fc1dbc3016d493e57 - Sigstore transparency entry: 1003316026
- Sigstore integration time:
-
Permalink:
HikaruEgashira/open-hook@bf055dc99a6547157351c187de627bf4843e3f8e -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/HikaruEgashira
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@bf055dc99a6547157351c187de627bf4843e3f8e -
Trigger Event:
push
-
Statement type:
File details
Details for the file openhook-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openhook-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
490916767ace9a65f10db3c4b7b17fb64de340e1e951082a620d953e8d7bcb18
|
|
| MD5 |
f37747ef06a01add02d78724fe0811f1
|
|
| BLAKE2b-256 |
d0573ca6380c075bdfea38f3e32b635f7fd34319ac8158a898530bfc2819089a
|
Provenance
The following attestation bundles were made for openhook-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on HikaruEgashira/open-hook
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openhook-0.1.0-py3-none-any.whl -
Subject digest:
490916767ace9a65f10db3c4b7b17fb64de340e1e951082a620d953e8d7bcb18 - Sigstore transparency entry: 1003316035
- Sigstore integration time:
-
Permalink:
HikaruEgashira/open-hook@bf055dc99a6547157351c187de627bf4843e3f8e -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/HikaruEgashira
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@bf055dc99a6547157351c187de627bf4843e3f8e -
Trigger Event:
push
-
Statement type: