Shell-to-TypeScript hook pattern with templates, six lifecycle events, and settings registration for Claude Code.
- CCM score
- 48 of 100
- skills.sh installs
- 511
- GitHub stars
- 4K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the shell wrapper and TypeScript handler pattern for files in
.claude/hooks/, with templates for both - Lists six hook events: PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, and Stop
- Shows how to test a hook manually by piping JSON into its shell wrapper
- Explains how to register hooks with matchers and commands in
.claude/settings.json
Install
$ npx -y skills add parcadei/continuous-claude-v3 --skill hooks -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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>.ts
TypeScript 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.sh
Details
- Repository
- github.com/parcadei/continuous-claude-v3
- Categories
- Skill & Plugin Building, CLI & Terminal
- First seen
- Jun 3, 2026
More from parcadei/continuous-claude-v3
All 108- Tldr Code511
- Prove510
- Hook Developer508
- Commit506
- Research External506
- Test506
- Background Agent Pings505
- Debug Hooks505
- Describe Pr505
- Shapely Compute504
- Braintrust Tracing500
- Workflow Router500
- Opc Architecture499
- Math Router498
- Mcp Scripts497
- Recall497
- Firecrawl Scrape496
- Help496
- Cli Reference494
- Completion Check494
- Idempotent Redundancy494
- Morph Search494
- Skill Upgrader494
- Build493
Similar to Hooks
More Skill & Plugin Buildinghook-developmentanthropics/claude-plugins-official8.4K installsGuide for writing Claude Code plugin hooks, covering prompt-based and command hook types across lifecycle events.
hook-developerparcadei/continuous-claude-v3508 installsComplete Claude Code hook reference covering input and output schemas for every event, plus registration and testing.
creating-claude-hooksagentworkforce/relay1.2K starsGuide for building executable Claude Code hooks, covering event types, I/O format, and PRPM packaging.
debug-hooksparcadei/continuous-claude-v3505 installsStep-by-step triage workflow for Claude Code hooks that won't fire or emit wrong output.
create-hookneolabhq/context-engineering-kit1.3K installsInteractive workflow that detects project tooling and creates tested git hooks for Claude Code.
groove-admin-claude-hooksandreadellacorte/groove533 installsInstalls groove's Claude Code shell hooks into settings.json for deterministic lifecycle actions without model involvement.