发布

  • fix: replace prompt-type Stop hook with command-type to prevent infinite loop

    frostbyte_neo 发布于 2026-04-09 15:58:09 +00:00

    The Stop hook used "type": "prompt" with an empty matcher, which caused an
    infinite loop: Claude responds to evaluate the condition → that triggers Stop
    again → hook fires again → repeat forever.

    Changes:

    • Stop hook: changed to "type": "command" that checks git diff for actual
      wiki/ file changes before outputting anything. Silent exit = no loop.
    • SessionStart: added matcher "startup|resume" so it only fires on relevant
      events, plus a command hook to cat hot.md directly.
    • Added PostCompact hook to re-inject hot cache after context compaction.
    • Added PostToolUse hook to auto-commit wiki changes on Write/Edit.

    Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

    下载附件