Event Hooks
Community

everything-claude-code

6 events · 26 hooks

Install
1
Install the plugin
$
npx claudepluginhub haniakrim21/everything-claude-code

Want just this hook?

Then install: npx claudepluginhub u/[userId]/[slug]

Risk Indicators
Executes bash commandsModifies files
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"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/stop-check.js\""
        }
      ],
      "matcher": "*",
      "description": "Remind about running tests and checking unstaged changes"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/notification-log.js\"",
          "timeout": 10
        }
      ],
      "matcher": "*",
      "description": "Log session stop events for audit trail to ~/.claude/notification-log.json"
    }
  ],
  "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 \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/block-dev-server.js\""
        }
      ],
      "matcher": "tool == \"Bash\" && tool_input.command matches \"(npm run dev|pnpm( run)? dev|yarn dev|bun run dev|next dev|vite|webpack serve|nodemon|ts-node-dev|python manage.py runserver|flask run|uvicorn|cargo watch)\"",
      "description": "Block dev servers outside tmux/screen"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"if(!process.env.TMUX&&!process.env.STY){console.error('[Hook] Consider running in tmux/screen for session persistence')}\""
        }
      ],
      "matcher": "tool == \"Bash\" && tool_input.command matches \"(npm (install|test)|pnpm (install|test)|yarn (install|test)?|bun (install|test)|cargo build|make|docker|pytest|vitest|playwright)\"",
      "description": "Reminder to use tmux/screen for long-running commands"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/pre-push-check.js\""
        }
      ],
      "matcher": "tool == \"Bash\" && tool_input.command matches \"git push\"",
      "description": "Block force push to main/master, warn on other risky pushes"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/commit-guard.js\""
        }
      ],
      "matcher": "tool == \"Bash\" && tool_input.command matches \"git commit\"",
      "description": "Validate conventional commit message format"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path||'';if(/\\.(md|txt)$/.test(p)&&!/(README|CLAUDE|AGENTS|CONTRIBUTING)\\.md$/.test(p)){console.error('[Hook] BLOCKED: Unnecessary documentation file creation');console.error('[Hook] File: '+p);console.error('[Hook] Use README.md for documentation instead');process.exit(1)}console.log(d)})\""
        }
      ],
      "matcher": "tool == \"Write\" && tool_input.file_path matches \"\\\\.(md|txt)$\" && !(tool_input.file_path matches \"README\\\\.md|CLAUDE\\\\.md|AGENTS\\\\.md|CONTRIBUTING\\\\.md\")",
      "description": "Block creation of random .md files - keeps docs consolidated"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/suggest-compact.js\""
        }
      ],
      "matcher": "tool == \"Edit\" || tool == \"Write\"",
      "description": "Suggest manual compaction at logical intervals"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/context-guard.js\""
        }
      ],
      "matcher": "tool == \"Bash\" || tool == \"Read\" || tool == \"Grep\" || tool == \"Task\"",
      "description": "Block tool calls when context window fills up — prevents Prompt is too long errors"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/block-md-creation.js\""
        }
      ],
      "matcher": "tool == \"Write\"",
      "description": "Warn about creating .md files outside standard documentation directories"
    }
  ],
  "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"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/learning-log.js\""
        }
      ],
      "matcher": "*",
      "description": "Log session activity and learnings"
    }
  ],
  "PostToolUse": [
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{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)}}console.log(d)})\""
        }
      ],
      "matcher": "tool == \"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',()=>{console.error('[Hook] Build completed - async analysis running in background');console.log(d)})\"",
          "timeout": 30
        }
      ],
      "matcher": "tool == \"Bash\" && tool_input.command matches \"(npm run build|pnpm build|yarn build)\"",
      "description": "Async build analysis notification"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/lint-fix.js\"",
          "timeout": 30
        }
      ],
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx|py|go|rs|css|scss|json)$\"",
      "description": "Auto-fix lint/format issues after edits (multi-language)"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/type-check.js\"",
          "timeout": 30
        }
      ],
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx)$\"",
      "description": "TypeScript type check after editing .ts/.tsx files"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path;if(p&&fs.existsSync(p)){const c=fs.readFileSync(p,'utf8');const lines=c.split('\\n');const matches=[];lines.forEach((l,idx)=>{if(/console\\.log/.test(l))matches.push((idx+1)+': '+l.trim())});if(matches.length){console.error('[Hook] WARNING: console.log found in '+p);matches.slice(0,5).forEach(m=>console.error(m));console.error('[Hook] Remove console.log before committing')}}console.log(d)})\""
        }
      ],
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx)$\"",
      "description": "Warn about console.log statements after edits"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/auto-test.js\"",
          "timeout": 60
        }
      ],
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx|py|go|rs)$\"",
      "description": "Auto-run related tests after editing source files"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/bundle-check.js\"",
          "timeout": 30
        }
      ],
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx|css|scss)$\"",
      "description": "Check bundle size after editing frontend files"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/secret-scanner.js\"",
          "timeout": 15
        }
      ],
      "matcher": "tool == \"Edit\" || tool == \"Write\"",
      "description": "Scan for leaked secrets after file changes"
    },
    {
      "hooks": [
        {
          "type": "command",
          "async": true,
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/lib/hook-runner.js\" \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/post-edit-check.js\"",
          "timeout": 30
        }
      ],
      "matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx|py|go|rs)$\"",
      "description": "Report lint issues after editing source files"
    }
  ],
  "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"
    },
    {
      "hooks": [
        {
          "type": "command",
          "command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/context-loader.js\""
        }
      ],
      "matcher": "*",
      "description": "Load project context (CLAUDE.md, git state, project type)"
    }
  ]
}
Summary
{
  "riskFlags": {
    "touchesBash": true,
    "matchAllTools": false,
    "touchesFileWrites": true
  },
  "typeStats": {
    "command": 26
  },
  "eventStats": {
    "Stop": 3,
    "PreCompact": 1,
    "PreToolUse": 8,
    "SessionEnd": 3,
    "PostToolUse": 9,
    "SessionStart": 2
  },
  "originCounts": {
    "absolutePaths": 0,
    "pluginScripts": 21,
    "projectScripts": 0
  },
  "timeoutStats": {
    "commandsWithoutTimeout": 18
  }
}
Stats
Stars1
Forks1
Last CommitFeb 26, 2026

Similar Hooks