Skip to content
Development
Hook

Hooks

What cc-best runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
cc-best
4919 skills8 agents44 commands20 hooks
Install
> /plugin marketplace add xiaobei930/cc-best
> /plugin install cc-best@cc-best

Ships with cc-best. Installing the plugin gets these hooks.

What fires, and when

PreToolUse

  • MatchesBashnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/validate-command.js"
  • MatchesBashnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/pause-before-push.js"
  • MatchesBashnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/check-secrets.js"
  • MatchesWrite|Editnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/protect-files.js"
  • MatchesWritenode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/block-random-md.js"
  • MatchesBashnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/long-running-warning.js"

PostToolUse

  • MatchesWrite|Editnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/format-file.js"
  • MatchesWrite|Editnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/auto-archive.js"
  • MatchesWrite|Edit|Bashnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/observe-patterns.js"
  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/suggest-compact.js"
  • MatchesWrite|Editnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/check-console-log.js"
  • MatchesWrite|Editnode "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/typescript-check.js"

UserPromptSubmit

Fires before Claude sees each prompt you send. A plugin can use it to inject context, so the same instruction reaches the model every turn instead of only at session start.

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/user-prompt-submit.js"

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/session-check.js"

Stop

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/stop-check.js"

SubagentStop

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/subagent-stop.js"

PreCompact

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/pre-compact.js"

PostCompact

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/post-compact.js"

PostToolUseFailure

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/post-tool-failure.js"

Notification

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/notification-handler.js"

SubagentStart

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/subagent-start.js"

SessionEnd

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/evaluate-session.js"

PermissionRequest

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/permission-request.js"

PermissionDenied

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/permission-denied.js"

InstructionsLoaded

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/instructions-loaded.js"

FileChanged

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/file-changed.js"

CwdChanged

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/cwd-changed.js"

ConfigChange

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/config-change.js"

MessageDisplay

  • node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/message-display.js"

TaskCompleted

  • Matches.*node "${CLAUDE_PLUGIN_ROOT}/scripts/node/hooks/task-completed.js"
Read hooks/hooks.json
Ships withcc-best

Role-Driven Development Workflow for Claude Code Transform Claude into a complete development team. From product requirements to code review — one plugin, full workflow. Quick Start • Features • Workflow • Commands • FAQ

Get the whole plugin