Skip to content

bug: hooks use invalid decision value "allow" — should be "approve" #872

Description

@sha2fiddy

PR #786 changed the save and precompact hooks from "decision": "block" to "decision": "allow" to stop the agent from writing in chat. The intent was right but "allow" isn't a valid value for the top-level decision field.

The fix is "allow""approve".

Update: "approve" isn't valid here either — it's a deprecated PreToolUse-only alias (maps to "allow" in hookSpecificOutput.permissionDecision). The top-level decision field only recognizes "block". To not block, you return empty JSON ({}).

Affected files:

  • hooks/mempal_save_hook.sh (line 159)
  • hooks/mempal_precompact_hook.sh (line 74)

Fix: Replace the full JSON output block with {} when not blocking. Only use {"decision": "block", "reason": "..."} when the hook actually needs to prevent the action.

Note: PR #863 already caught this — mvalentsev replaced the invalid {"decision": "allow", ...} with {} in hooks_cli.py. The standalone bash hooks still need the same treatment.

Related: #856, #858 (report compaction symptoms that may stem from this)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/hooksClaude Code hook scripts (Stop, PreCompact, SessionStart)bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions