hook
Routes Claude Code lifecycle events (session-start, post-compact, post-commit, checkpoint) with client-read git facts to Worktrail and returns the script's JSON output.
Instructions
For the Claude Code hook script only (thin client) — not for agents. event = session-start | post-compact | post-commit | checkpoint; facts = git facts of the worktree read on the client (threads.local_facts). Returns the hook's JSON output.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"event": "<event>",
"facts": "<facts>"
},
"name": "hook"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| why | No | ||
| event | Yes | ||
| facts | Yes | ||
| reason | No |