@parcadei/hooks

Context management for Claude Code. Hooks maintain state via ledgers and handoffs. MCP execution without context pollution. Agent orchestration with isolated context windows.

View in AI SkillSafe app
Scanned · no findings
7369 downloads
0 stars
0 demos
SKILL.md
namehooks
descriptionHook Development Rules
user-invocablefalse

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"
      }]
    }]
  }
}

Embed badges

Add these to your README to show the skill's verification status.

SkillSafe verified badge
Verified badge
[![SkillSafe verified badge](https://api.skillsafe.ai/v1/badge/@parcadei/hooks/verified)](https://skillsafe.ai/skill/@parcadei/hooks/)
Installs badge
Installs badge
[![Installs badge](https://api.skillsafe.ai/v1/badge/@parcadei/hooks/installs)](https://skillsafe.ai/skill/@parcadei/hooks/)
Scan badge
Scan badge
[![Scan badge](https://api.skillsafe.ai/v1/badge/@parcadei/hooks/scan)](https://skillsafe.ai/skill/@parcadei/hooks/)
Eval pass rate badge
Eval pass rate
[![Eval pass rate badge](https://api.skillsafe.ai/v1/badge/@parcadei/hooks/eval)](https://skillsafe.ai/skill/@parcadei/hooks/)