What problem does it solve?
It solves the problem of reliably authoring and auditing runtime hooks so they enforce guardrails consistently across Claude, Codex, and Gemini without unsafe timeouts, malformed outputs, or coverage gaps.
Core Features & Use Cases
- Cross-CLI hook correctness: Ensures a single hook implementation can run under CC, Codex, and Gemini via the shared
.claude/hooks/<name>.js entry point and normalized COC_RUNTIME payload handling.
- Deterministic halting with disciplined output: Guarantees halting branches use the canonical
lib/instruct-and-wait.js::emit() shape (including severity, reporting, and waiting requirements) rather than raw exits.
- Timeout fallback and portability: Enforces mandatory
setTimeout behavior to prevent session hangs and applies correct project-dir resolution across CLIs.
- Coverage and safety alignment: Prevents “Bash-only” enforcement blind spots by requiring predicate bijection with
.claude/codex-mcp-guard/policies.json and blocking divergence at sync time.
Quick Start
Use the hook-authoring skill to audit or implement a hook script named .claude/hooks/<name>.js and verify it follows the required timeout fallback, output discipline, and predicate-coverage bijection rules.