/hook-harness:hook-harness [owner] [what to wait for]from hook-harness
Wait for and react to GitHub events (merge-queue ejections, failed main CI, slash-command comments, labelled issues) through a hook-harness relay, using the MCP server or the CLI.
Ships in hook-harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Reads GitHub events stored by a hook-harness relay (a Lambda plus DynamoDB, 1 day retention). Use the MCP server when available (wait_for_events, get_events); otherwise the CLI (npx -y hook-harness wait). hook-harness serve (a local SSE daemon) is optional and not needed for either path.
hook-harness login --url <function url> --token <hh_...>, or set HOOK_HARNESS_URL and HOOK_HARNESS_TOKEN.hook-harness token create --repos '<owner>/*' --label <who> --login (prints the token once and saves the login). --repos takes owner/name, owner/* or *; --expires takes 90d, 12h, 30m.owner/* or owner/name. A 401/403 means a bad, expired or out-of-scope token. Never print the token in chat or logs.MCP wait_for_events inputs: owner (several as a comma list; one cursor covers them all), repos?, filters? (EventFilter[], OR'd; unknown keys are rejected), after? (cursor), since? (ISO time or duration like 2h), cursor_name? (persist the cursor in a local state file instead of passing after), include_payload? (default true), timeout_seconds? (1–600, default 240) and settle_seconds? (0–60, default 5). get_events takes the same inputs minus the timeouts and runs a single poll. filter_help returns the filter reference with examples. CLI equivalent:
hook-harness wait --owner acme --filter '<json>' --after "$CURSOR" --timeout 30m
Both return {"events":[...],"gap":false,"cursor":"...","timedOut":true?}. The CLI exits 0 in all cases (read the JSON); exit 1 means auth failure, invalid cursor, or relay unreachable until the timeout. The MCP tools report those as tool errors. A 401 means the user must run hook-harness login; a 403 names an owner the token's repo scope doesn't cover, which needs a new token from hook-harness token create --login --repos ...,<owner>/*, not a login.
Rules:
cursor (file, memory, task state) after handling events and pass it as after next time. Without after, both start from since if given, then the named state file (MCP: only with cursor_name; CLI: default or --cursor <name>), then now.id. The same delivery can reappear across polls or as a replay.gap: true means your cursor is older than the retention window and events were lost. Sweep the GitHub API (open PRs, recent runs, issues) to resync, handle events too, then continue from the returned cursor.wait blocks up to the timeout. Claude Code: run the CLI with Bash run_in_background or under Monitor, and keep the MCP tool's timeout_seconds under the client's tool-call limit (MCP_TOOL_TIMEOUT in Claude Code). Codex: use the equivalent background command or a separate session. Loop: wait, handle, persist cursor, wait again.--event --action --reason --conclusion --branch --workflow --command --sender --label --reviewer --sha --ref --pr --min-association --ignore-sender --repo --no-payload --since --settle --interval --cursor. --filter '<json>' is repeatable; filters are OR'd.--on (MCP: on) takes ejection, main-failure, dependabot-pr, review-requested[:<login|team>], label:<name> and /<command>, repeatable or comma lists, OR'd with other filters. Prefer them over hand-written JSON.A filter ANDs its fields; each field takes a string or array. Fields: repo, event, action, reason, conclusion, branch (baseRef for PR events, else headRef), workflow, command, sender, label, reviewer, sha (headSha), ref (headRef or baseRef), pr, minAssociation, ignoreSenders. Every action is stored, so always set action or you will match edits, closes and labels you did not mean to.
Merge-queue ejections: use the ejection preset. dequeued also fires with reason: "MERGE" on a successful merge (and MANUAL when someone removes a PR), and filters cannot negate, so the preset lists the failure reasons; reason says why a PR was ejected (e.g. CI_FAILURE, MERGE_CONFLICT).
A label added to an issue or PR (the label:needs-review preset); label is set on labeled/unlabeled actions and reviewer on review_requested:
{ "action": "labeled", "label": "needs-review" }
To react only to one ejection cause, add it: {"event":"pull_request","action":"dequeued","reason":"CI_FAILURE"}.
Failed main CI:
{
"event": ["workflow_run", "check_suite"],
"action": "completed",
"conclusion": "failure",
"branch": "main"
}
/shepherd comments from members:
{
"event": "issue_comment",
"action": "created",
"command": "/shepherd",
"minAssociation": "MEMBER"
}
New issues labelled flaky (inspect payload.label.name; action is labeled for later labels, opened when created with it):
[
{ "event": "issues", "action": "labeled" },
{ "event": "issues", "action": "opened" }
]
Then keep events where payload.label.name == "flaky" or payload.issue.labels[].name contains flaky.
include_payload: false / --no-payload when the envelope is enough.authorAssociation (OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, ...) and author (the comment author; sender is who triggered the delivery and differs on edit and delete). minAssociation is a coarse pre-filter only.minAssociation: MEMBER can miss real members. Before anything privileged (merging, pushing, deploying), verify with the GitHub API (for example gh api orgs/<org>/memberships/<login> or the collaborator permission endpoint).command is only the lowercased first token, so a command match is a trigger, not authorization.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub jonathanong/hook-harness --plugin hook-harness