Skip to main content

MC 101650 Hook PreToolUse Killswitch Consolidation

MC 101650 Hook PreToolUse Killswitch Consolidation

Verdict: PASS
Date: 2026-05-21
Task: [P3-4] Hook consolidation: merge PreToolUse matchers, eliminate 6x killswitch + duplicate fires

Summary

~/.claude/settings.json had killswitch-gate.sh repeated in every PreToolUse matcher group. For Task, multiple matcher groups also matched, causing duplicate killswitch execution. The PreToolUse killswitch is now centralized in one universal matcher while specialized gates remain in their original matcher groups.

Change

  • Added first PreToolUse entry: matcher .*bash $HOME/system/hooks/killswitch-gate.sh.
  • Removed killswitch-gate.sh from the specific PreToolUse matcher entries:
    • Bash
    • Task|WebSearch|WebFetch
    • Task
    • mcp__playwright__.*
    • Write|Edit|MultiEdit
  • Preserved UserPromptSubmit killswitch separately because it is a different hook event.
  • Backed up settings to ~/.claude/settings.json.bak-101650.
  • Restored uchg immutable flag on ~/.claude/settings.json.

Validation

  • settings.json JSON-valid.
  • PreToolUse killswitch occurrences reduced from 5 to 1.
  • Total killswitch occurrences reduced from 6 to 2:
    • one PreToolUse universal matcher,
    • one UserPromptSubmit gate.
  • Representative matching analysis shows exactly one PreToolUse killswitch for:
    • Bash
    • Task
    • WebSearch
    • WebFetch
    • mcp__playwright__click
    • Write/Edit/MultiEdit
  • Killswitch OFF smoke: killswitch-gate.sh exits 0 with empty stdout/stderr.

Evidence

  • /tmp/101650-hook-inventory.txt
  • /tmp/101650-post-consolidation-analysis.txt
  • /tmp/101650-smoke-validation.txt
  • /tmp/101650-evidence/