From 94e54f69453dea0feda4722347ba3c60c9822c2b Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 19 Jul 2026 21:04:43 -0500 Subject: feat(hooks): soft-nudge pending inbox handoffs at task boundaries The "check inbox/ at every task boundary" rule was prose-only in protocols.org, so it held only as well as the agent remembered it and a handoff could pass a turn unseen. inbox-boundary-check.sh is a Stop hook that backs the rule: when inbox-status -q reports pending items it blocks the yield once and injects the count, so the agent processes them before returning. It soft-nudges rather than hard-blocks. On the harness re-entry (stop_hook_active: true) the hook steps aside and lets the turn end, so a mid-task pause to ask a question, or an item the agent genuinely can't process, never wedges the session. A hard block would instead push inbox processing ahead of that clarifying question. The hook self-skips where it doesn't apply: no inbox/ dir, no inbox-status, or a clean inbox each exit 0 silently, so one global hook covers every project with no config. It prefers the project-local .ai/scripts/inbox-status and falls back to one on PATH. It's wired into the Stop array ahead of ai-wrap-teardown in both the tracked settings.json (which the live ~/.claude/settings.json symlinks to) and the documented snippet. bats covers pending, clean, the re-entry step-aside, no-inbox, and the absent-status degrade. --- hooks/settings-snippet.json | 1 + 1 file changed, 1 insertion(+) (limited to 'hooks/settings-snippet.json') diff --git a/hooks/settings-snippet.json b/hooks/settings-snippet.json index 0f0e784..26cbc18 100644 --- a/hooks/settings-snippet.json +++ b/hooks/settings-snippet.json @@ -34,6 +34,7 @@ "Stop": [ { "hooks": [ + { "type": "command", "command": "~/.claude/hooks/inbox-boundary-check.sh" }, { "type": "command", "command": "~/.claude/hooks/ai-wrap-teardown.sh" } ] } -- cgit v1.2.3