Convention: PreToolUse hook matchers must use separate entries, not pipe-separated #166
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom#166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Discovered scope from GroupMe incident remediation (2026-03-25). Four restart cycles to diagnose.
Repo
forgejo_admin/claude-customUser Story
As platform operator,
I want a documented convention and audit for PreToolUse hook matchers,
So that future hooks work correctly in
--dangerously-skip-permissionsmode without multi-restart debugging cycles.Context
Finding (2026-03-25): PreToolUse hooks with pipe-separated matchers (e.g.,
mcp__groupme__send_message|mcp__groupme__add_member|mcp__groupme__remove_member) do NOT enforcepermissionDecision: "ask"in--dangerously-skip-permissionsmode. The hook fires (sentinel file proves it), the JSON output is correct, but the permission prompt is silently swallowed.Splitting the same matcher into three separate entries fixes it. Single-tool matchers like
mcp__forgejo__merge_approved_pralways worked — the pipe separator is the problem.This cost four session restarts, multiple test messages to the wrong group, and hours of debugging. The fix is simple but the pattern needs to be documented so no future hook repeats this mistake.
File Targets
Files to modify:
settings.json— AUDIT all existing pipe-separated PreToolUse matchers. Split any that usepermissionDecision: "ask"into separate entries. Currently affected: the groupme entries NEEDS splitting — line 103 still pipe-separated. Check ifmcp__forgejo__create_issue|mcp__forgejo__create_issue_and_branchorWrite|Edit|NotebookEdithave the same issue.convention-hook-matcher-patterndocumenting: (1) pipe-separated matchers work for PostToolUse but NOT reliably for PreToolUsepermissionDecision: "ask"in bypass mode, (2) always use separate entries for PreToolUse approval hooksFiles NOT to touch:
Acceptance Criteria
permissionDecision: "ask"use separate entries (one tool per matcher)convention-hook-matcher-patterncreated in pal-e-docsTest Expectations
--dangerously-skip-permissionsmodeConstraints
permissionDecision: "ask"are affectedChecklist
Related
claude-custom#160— GroupMe incident that exposed thisclaude-custom#164— auto-pull hook (related deployment gap)project-pal-e-agency— enforcement architectureScope Review: READY
Review note:
review-377-2026-03-25Scope is solid — all template sections present, file targets verified, no blocking dependencies. Audit finding: the two remaining pipe-separated PreToolUse matchers (
Write|Edit|NotebookEditandcreate_issue|create_issue_and_branch) do NOT returnpermissionDecision: "ask", so they are not affected by this bug and do not need splitting. Remaining work is convention note creation + optional config annotation.Scope Review: NEEDS_REFINEMENT
Review note:
review-377-2026-03-27Template complete, traceability complete, acceptance criteria testable, blast radius clean.
One factual error blocks READY status:
settings.jsonstill has the pipe-separated matchermcp__groupme__send_message|mcp__groupme__add_member|mcp__groupme__remove_member. An implementing agent may skip the split if it reads "already done."Fix needed: Update the File Targets bullet for
settings.jsonto say the GroupMe matcher NEEDS splitting, not that it's already split. Once corrected, this upgrades to READY.Scope Review Corrections Needed
From
review-377-2026-03-27:Fix 1: File Targets section says GroupMe matcher entries are "already split (fixed during incident)" — this is incorrect. Line 103 of
settings.jsonstill has the pipe-separated matcher:mcp__groupme__send_message|mcp__groupme__add_member|mcp__groupme__remove_member. Update the issue body to say this NEEDS splitting.Once fixed → READY for next_up.
Issue body updated per scope review corrections.