Feature Request: PreToolUse hook support for deny/block

Open 💬 0 comments Opened Jul 14, 2026 by luolulu2009-wwxd

Problem

Loop Engineering configurations (CLAUDE.md rules + hooks) can enforce development processes at commit time via git pre-commit hooks, but CANNOT enforce processes at planning/coding time.

What happens now: PreToolUse hooks can only inject context messages. They cannot prevent the Agent from executing a tool call. This means rules like "MUST invoke to-prd before writing code" are advisory only — the Agent can choose to skip them.

What we need: PreToolUse hooks should support returning a "deny" signal that blocks the tool call. This would enable:

  • Enforcing Intake Pipeline (to-prd → grill-me → to-issues) before any Edit/Write
  • Enforcing Dual Agent review before pushing
  • Enforcing design review before UI changes
  • Blocking main-branch direct commits in CI

Use Case

We built a 7-gate pre-commit system using git hooks that blocks commits if:

  • No active issue file exists
  • No Plan Gate marker (≥3 files changed)
  • No Dual Agent review (≥30 lines changed)
  • No Accept Gate checklist (marking issue done)

The commit-time enforcement works perfectly. But the planning-time enforcement (Intake Pipeline) cannot be enforced mechanically — only through CLAUDE.md text that the Agent may skip.

Proposed API

// PreToolUse hook response
{
  "action": "deny",
  "message": "No active issue found in .scratch/. Create one before editing."
}
// or
{
  "action": "allow",
  "message": "Issue verified, proceeding."
}

Workaround (current)

We use a combination of:

  1. CLAUDE.md rules (advisory)
  2. SessionStart hook (context injection)
  3. UserPromptSubmit hook (reminders)
  4. Git pre-commit hook (blocking, but too late — code already written)

All of these are partial solutions. PreToolUse deny would make the Loop Engineering system truly un-bypassable.

View original on GitHub ↗