hook-harness
GitHub events in, agent runs out.
A GitHub App sends webhooks to a small AWS Lambda, which stores a short summary of each event in DynamoDB for one day. A runner on your machine polls those events and, when a rule matches, renders a prompt and starts Claude Code, Codex, or any other CLI in a git worktree.
- No control plane. One Lambda function URL and one DynamoDB table with TTL. Typical cost: cents per month.
- No always-on connection. The runner polls; a session that starts late catches up on the last day of events.
- Envelope plus payload. Each event has a small envelope (IDs, refs, outcomes) for filtering and the webhook payload, minus
installation and, by default, repository and organization. Configure with PayloadDrop / PayloadMaxBytes; pollers can skip payloads with payload=0. Payload text is untrusted input.
- All comments are stored. Every issue, PR, review and review comment event is kept (comments: created, edited, deleted); there is no command allowlist.
command is the lowercased first token of the body when it looks like /plan (else null), so agents filter with --command /plan. authorAssociation (OWNER, MEMBER, COLLABORATOR, ...) and author (the comment author, who can differ from sender on edits and deletes) give provenance. GitHub reports organization members with private membership as CONTRIBUTOR or NONE in webhooks, so use --min-association carefully or verify membership via the API.
Status: under construction. See docs/ for the design.
Install
npx hook-harness deploy # run any command without installing
pnpm add -g hook-harness # or install globally, then: hook-harness <command>
Alarms: hook-harness update --alarm-email [email protected] adds CloudWatch alarms for relay 5xx responses, throttles, and no webhook stored for --alarm-quiet-hours (default 12). Confirm the subscription email AWS sends; --alarm-email "" removes them.
Requires Node 24+. The package bundles the relay Lambda code and CloudFormation template that deploy and update use. Publishing is described in docs/publishing.md.
Install the plugin
The plugin gives an agent the hook-harness mcp server (wait_for_events, get_events) and a hook-harness skill that teaches it to log in, wait with a caller-owned cursor, write filters and treat payloads as untrusted.
# Claude Code
/plugin marketplace add jonathanong/hook-harness # inside Claude Code
/plugin install hook-harness@hook-harness
# Codex (then enable the hook-harness plugin)
codex plugin marketplace add jonathanong/hook-harness
The MCP server runs npx -y hook-harness mcp. Log in once with hook-harness login (see docs/github-app.md for tokens). Optional: hook-harness serve runs a local SSE daemon.
Common triggers
--on adds named filters (repeatable or comma lists; OR'd with any other filters). The MCP tools take the same names as on.
| Preset | Matches |
|---|
ejection | Merge-queue ejection (pull_request dequeued with a failure reason, not MERGE) |
main-failure | Failed workflow_run, or another App's check_suite (not Actions'), on main |
dependabot-pr | Dependabot opened or reopened a PR |
review-requested, review-requested:<login|team> | A review was requested (from that reviewer) |
label:<name> | That label was added to an issue or PR |
/<command> | A new comment starting with that command, e.g. /shepherd |
hook-harness wait --owner acme --on ejection,main-failure,dependabot-pr,/shepherd --on label:needs-review --no-payload
Field flags (--event --action --reason --conclusion --branch --workflow --command --sender --label --reviewer --sha --ref --pr) build one more filter; --filter '<json>' adds arbitrary ones.
Sharing one poller: hook-harness serve
Several agents on one machine can share a single relay poller. serve polls the relay once and fans events out over Server-Sent Events; wait and tail read from it with --source (or HOOK_HARNESS_SOURCE) and print exactly what they print when polling the relay.