BuildHook

Create and validate Forge module hook scripts for Claude Code events.

5|3|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/N4M3Z/forge-core --skill buildhook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: BuildHook
Source: https://github.com/N4M3Z/forge-core/tree/main/skills/BuildHook
Command: npx skills add https://github.com/N4M3Z/forge-core --skill buildhook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create and validate hook scripts that integrate Forge modules with Claude Code events, ensuring hooks are correctly named, registered, and executable.

Core Features & Use Cases

  • Scaffold hooks following PascalCase naming for events like SessionStart, PreToolUse, Stop, and others.
  • Validate hook scripts for executable permissions, correct shebang, dual-mode MODULE_ROOT resolution, and proper stdin handling.
  • Enforce registration requirements through module.yaml and defaults.yaml, including events and module listings.

Quick Start

Scaffold and initialize a new hook for a Claude Code event.

Frequently Asked Questions about BuildHook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create hook scripts for Claude Code events in forge modules?

You can create hook scripts for Claude Code events by scaffolding them with PascalCase naming conventions for events like SessionStart, PreToolUse, and Stop, ensuring proper executable permissions, shebang, and module registration in module.yaml and defaults.yaml.

What is dual-mode MODULE_ROOT resolution when validating hook scripts?

Dual-mode MODULE_ROOT resolution is a validation check ensuring hook scripts correctly resolve their module root directory path across different execution contexts, alongside proper stdin handling and exit code conventions for Gate and Passive modes.

How do I register forge module hooks for events routing?

To register forge module hooks for events routing, you must list the hooks in module.yaml and defaults.yaml, specifying the events and module listings to ensure Claude Code correctly triggers the SessionStart, PreToolUse, or Stop hooks.

What exit code conventions do Claude Code hooks use for Gate and Passive modes?

Claude Code hooks use specific exit code conventions for Gate and Passive modes to determine whether a tool execution should be blocked or allowed to proceed silently during the event routing process.

Why does my forge module hook fail validation during events routing?

Forge module hook validation fails when scripts lack executable permissions, have an incorrect shebang, fail dual-mode MODULE_ROOT resolution, improperly handle stdin, or are missing registration entries in module.yaml and defaults.yaml.

Do I need to configure defaults.yaml to use Claude Code hook scripts?

Yes, you need to configure defaults.yaml alongside module.yaml because registration requirements enforce proper events routing and module listings, ensuring Claude Code correctly discovers and executes your validated hook scripts.