Project not found.

Bug: PreToolUse merge hook errors silently

bug-merge-hook-silent-error Doc

bug resolved

Problem

The PreToolUse:mcp__forgejo__merge_approved_pr hook threw an error on every merge but did not block. Merges proceeded despite the error. The agent could not see the error in tool results.

Root Cause

block-mcp-merge.sh used permissionDecision: "allow_with_user_confirmation" which is not a valid Claude Code hook value. Valid values are allow, deny, ask. Claude Code failed open -- showed "hook error" in the CLI but proceeded with the tool call.

Fix

Changed permissionDecision from "allow_with_user_confirmation" to "ask" in ~/.claude/hooks/block-mcp-merge.sh. This matches the working pattern in block-pr-merge.sh.

Impact

Every MCP merge showed a "hook error" in the CLI. The merge gate was effectively disabled -- merges proceeded without the intended prompt. Low actual risk because Lucas was manually approving merges, but the hook's purpose was undermined.

Acceptance Criteria

  • Hook prompts user cleanly on next merge (no "hook error" message)
  • Merge proceeds only after user approval
  • ai-agency -- project (claude-custom repo)
  • plan-2026-02-26-tf-modularize-postgres -- discovered during Phase 8b/8c work