hooks

Hook Development Rules

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hooks" with this command: npx skills add parcadei/continuous-claude-v3/parcadei-continuous-claude-v3-hooks

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

Registration

Add hooks to .claude/settings.json :

{ "hooks": { "EventName": [{ "matcher": ["pattern"], // Optional "hooks": [{ "type": "command", "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/hook.sh" }] }] } }

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

github-search

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

dead-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

skill-development

No summary provided by upstream source.

Repository SourceNeeds Review