
Hooks
- 492 installs
- 3.9k repo stars
- Updated January 26, 2026
- parcadei/continuous-claude-v3
hooks is a Claude Code skill that defines how to build `.claude/hooks/` handlers using shell wrappers and TypeScript so agents trigger custom actions at precise session events.
About
hooks is a skill from parcadei/continuous-claude-v3 that documents Hook Development Rules for Claude Code. The pattern pipes stdin through a shell wrapper that runs `npx tsx` on a TypeScript handler inside `.claude/hooks/`. Handlers parse JSON HookInput, return `continue` or `block` results, and optionally emit system reminders. Developers reach for it when automating guardrails, reminders, or validations at hook events during long coding sessions. The skill is not user-invocable directly; it guides file edits in the hooks directory. Use it when extending Claude Code with event-driven automation.
- Attaches persistent hooks to Claude Code sessions
- Runs user-defined scripts on events like file changes, command completion, or context updates
- Enables continuous agentic workflows without manual intervention
- Supports 4 core hook types: pre-command, post-command, on-save, on-error
- Seamless handoff to nextSkills when events complete
Hooks by the numbers
- 492 all-time installs (skills.sh)
- +2 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #1,789 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill hooksAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 492 |
|---|---|
| repo stars | ★ 3.9k |
| Last updated | January 26, 2026 |
| Repository | parcadei/continuous-claude-v3 ↗ |
How do you write Claude Code hook handlers in TypeScript?
Let Claude automatically trigger custom actions at precise moments during long-running coding sessions.
Who is it for?
Claude Code extenders building event-driven automations with shell wrappers and TypeScript handlers.
Skip if: Developers not using Claude Code hooks or teams needing one-off scripts outside `.claude/hooks/` event flow.
When should I use this skill?
User edits `.claude/hooks/`, asks about HookInput JSON, or wants continue/block hook automation in Claude Code
What you get
Shell wrapper scripts, TypeScript hook handlers, and JSON continue/block responses for Claude Code events
- Shell hook wrappers
- TypeScript hook handlers
- JSON hook responses
Files
Hook Development Rules
When working with files in .claude/hooks/:
Pattern
Shell wrapper (.sh) → TypeScript (.ts) via npx tsx
Shell Wrapper Template
#!/bin/bash
set -e
cd "$CLAUDE_PROJECT_DIR/.claude/hooks"
cat | npx tsx <handler>.tsTypeScript Handler Pattern
interface HookInput {
// Event-specific fields
}
async function main() {
const input: HookInput = JSON.parse(await readStdin());
// Process input
const output = {
result: 'continue', // or 'block'
message: 'Optional system reminder'
};
console.log(JSON.stringify(output));
}Hook Events
- PreToolUse - Before tool execution (can block)
- PostToolUse - After tool execution
- UserPromptSubmit - Before processing user prompt
- PreCompact - Before context compaction
- SessionStart - On session start/resume/compact
- Stop - When agent finishes
Testing
Test hooks manually:
echo '{"type": "resume"}' | .claude/hooks/session-start-continuity.shRegistration
Add hooks to .claude/settings.json:
{
"hooks": {
"EventName": [{
"matcher": ["pattern"], // Optional
"hooks": [{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/hook.sh"
}]
}]
}
}Related skills
FAQ
What is the hooks skill pattern?
The hooks skill specifies a shell wrapper in `.claude/hooks/` that pipes stdin to `npx tsx <handler>.ts`. The TypeScript file parses HookInput JSON and prints a JSON result with `continue` or `block` plus an optional message.
When does the hooks skill apply?
The hooks skill applies when editing Claude Code hook files under `.claude/hooks/`. It is marked user-invocable false and instead guides developers implementing event-driven automations during coding sessions.