Event Hooks

everything-claude-code

6 events · 17 hooks

From everything-claude-code
Install
1
Run in your terminal
$
npx claudepluginhub ysyecust/everything-claude-code --plugin everything-claude-code
Risk Indicators
Executes bash commandsModifies filesMatches all tools
Source

Defined in hooks/hooks.json

Configuration
{
  "Stop": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/check-console-log.js\""
        }
      ],
      "matcher": "*",
      "description": "Check for console.log in modified files after each response"
    }
  ],
  "PreCompact": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/pre-compact.js\""
        }
      ],
      "matcher": "*",
      "description": "Save state before context compaction"
    }
  ],
  "PreToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(process.platform!=='win32'&&/(npm run dev\\b|pnpm( run)? dev\\b|yarn dev\\b|bun run dev\\b)/.test(cmd)){console.error('[Hook] BLOCKED: Dev server must run in tmux for log access');console.error('[Hook] Use: tmux new-session -d -s dev \\\"npm run dev\\\"');console.error('[Hook] Then: tmux attach -t dev');process.exit(2)}}catch{}console.log(d)})\""
        }
      ],
      "matcher": "Bash",
      "description": "Block dev servers outside tmux - ensures you can access logs"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(process.platform!=='win32'&&!process.env.TMUX&&/(npm (install|test)|pnpm (install|test)|yarn (install|test)?|bun (install|test)|cargo build|make\\b|docker\\b|pytest|vitest|playwright)/.test(cmd)){console.error('[Hook] Consider running in tmux for session persistence');console.error('[Hook] tmux new -s dev  |  tmux attach -t dev')}}catch{}console.log(d)})\""
        }
      ],
      "matcher": "Bash",
      "description": "Reminder to use tmux for long-running commands"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(/git push/.test(cmd)){console.error('[Hook] Review changes before push...');console.error('[Hook] Continuing with push (remove this hook to add interactive review)')}}catch{}console.log(d)})\""
        }
      ],
      "matcher": "Bash",
      "description": "Reminder before git push to review changes"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/doc-file-warning.js\""
        }
      ],
      "matcher": "Write",
      "description": "Doc file warning: warn about non-standard documentation files (exit code 0; warns only)"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/suggest-compact.js\""
        }
      ],
      "matcher": "Edit|Write",
      "description": "Suggest manual compaction at logical intervals"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh",
          "timeout": 10
        }
      ],
      "matcher": "*",
      "description": "Capture tool use observations for continuous learning"
    }
  ],
  "SessionEnd": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-end.js\""
        }
      ],
      "matcher": "*",
      "description": "Persist session state on end"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/evaluate-session.js\""
        }
      ],
      "matcher": "*",
      "description": "Evaluate session for extractable patterns"
    }
  ],
  "PostToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(/gh pr create/.test(cmd)){const out=i.tool_output?.output||'';const m=out.match(/https:\\/\\/github.com\\/[^/]+\\/[^/]+\\/pull\\/\\d+/);if(m){console.error('[Hook] PR created: '+m[0]);const repo=m[0].replace(/https:\\/\\/github.com\\/([^/]+\\/[^/]+)\\/pull\\/\\d+/,'$1');const pr=m[0].replace(/.+\\/pull\\/(\\d+)/,'$1');console.error('[Hook] To review: gh pr review '+pr+' --repo '+repo)}}}catch{}console.log(d)})\""
        }
      ],
      "matcher": "Bash",
      "description": "Log PR URL and provide review command after PR creation"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(/(npm run build|pnpm build|yarn build)/.test(cmd)){console.error('[Hook] Build completed - async analysis running in background')}}catch{}console.log(d)})\"",
          "timeout": 30
        }
      ],
      "matcher": "Bash",
      "description": "Example: async hook for build analysis (runs in background without blocking)"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-edit-format.js\""
        }
      ],
      "matcher": "Edit",
      "description": "Auto-format JS/TS files after edits (auto-detects Biome or Prettier)"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-edit-typecheck.js\""
        }
      ],
      "matcher": "Edit",
      "description": "TypeScript check after editing .ts/.tsx files"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-edit-console-warn.js\""
        }
      ],
      "matcher": "Edit",
      "description": "Warn about console.log statements after edits"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh",
          "timeout": 10
        }
      ],
      "matcher": "*",
      "description": "Capture tool use results for continuous learning"
    }
  ],
  "SessionStart": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-start.js\""
        }
      ],
      "matcher": "*",
      "description": "Load previous context and detect package manager on new session"
    }
  ]
}
Summary
{
  "riskFlags": {
    "touchesBash": true,
    "matchAllTools": true,
    "touchesFileWrites": true
  },
  "typeStats": {
    "command": 17
  },
  "eventStats": {
    "Stop": 1,
    "PreCompact": 1,
    "PreToolUse": 6,
    "SessionEnd": 2,
    "PostToolUse": 6,
    "SessionStart": 1
  },
  "originCounts": {
    "absolutePaths": 0,
    "pluginScripts": 12,
    "projectScripts": 0
  },
  "timeoutStats": {
    "commandsWithoutTimeout": 14
  }
}
Stats
Stars4
Forks0
Last CommitMar 3, 2026