Skip to content

improvement: document hook exit code 2 vs 1 semantics #455

@Luis85

Description

@Luis85

Context

Part of the plugin audit in #444 (§3, §8 Quick Wins). The Claude Code hook system inverts the standard Unix exit-code convention in a way that is not obvious and has caused production bugs:

Exit code 2 = blocking (Claude Code halts the action).
Exit code 1 = non-blocking (execution continues — most scripts' error default).

Hook scripts that exit 1 on invalid input are silently passing through. This is a common source of branch guard failures.

Work

  1. Add a docs/hooks.md (or update docs/branching.md / relevant doc) with:
  2. Add a one-liner note to CLAUDE.md or the branch guard hook comment referencing this doc

Definition of Done

  • docs/hooks.md (or updated equivalent) documents the exit-code inversion prominently
  • Branch guard hook file has an inline comment citing the exit 2 requirement
  • Verify gate green

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2High / next-up, important but not blockingdocumentationImprovements or additions to documentationroadmap:automation-hardeningv0.7 automation contract — registry, verify tiers, agent checks, Zod runtime validationtrack:specorator-improvementImprovement to the Specorator template itself

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions