Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/swt-labs/vibe-better-with-claude-code-vbw/llms.txt

Use this file to discover all available pages before exploring further.

VBW installs 22 hook handlers across 11 Claude Code event types. Hooks run automatically after installation — no configuration needed. They execute as bash subprocesses at zero model token cost. All hooks route through hook-wrapper.sh, which provides graceful degradation: if a hook script is missing or fails unexpectedly, the wrapper logs the error to .vbw-planning/.hook-errors.log and exits 0. No hook can break a session.

Verification hooks

Verification hooks enforce quality gates on agent output — SUMMARY.md structure, commit format, frontmatter, task completion, and agent lifecycle.
EventHandlerWhat it does
PostToolUse (Write|Edit)validate-summary.shValidates SUMMARY.md structure on write
PostToolUse (Write|Edit)validate-frontmatter.shValidates frontmatter descriptions
PostToolUse (Bash)validate-commit.shChecks conventional commit format
PostToolUse (Write|Edit|Bash)skill-hook-dispatch.shDispatches skill-defined hook handlers
PostToolUse (Write|Edit)state-updater.shUpdates execution state
SubagentStartagent-start.shWrites agent marker (role normalization, concurrency-safe)
SubagentStopagent-stop.shValidates SUMMARY.md, cleans markers, corruption recovery
TeammateIdleqa-gate.shTiered SUMMARY.md gate (1-plan grace, 2+ gap blocks)
TaskCompletedtask-verify.shVerifies task-related commit exists via keyword matching

Security hooks

Security hooks intercept tool calls before they reach the shell or filesystem. They are fail-closed: any parse error or unexpected condition blocks the call rather than allowing it through.
EventHandlerWhat it does
PreToolUse (Bash)bash-guard.shBlocks destructive bash commands (40+ patterns)
PreToolUse (Read|Glob|Grep|Write|Edit)security-filter.shBlocks access to .env, private keys, and credential files
PreToolUse (Write|Edit)file-guard.shEnforces plan file boundaries; blocks writes to files not declared in the active plan
See Database Safety Guard for the full pattern list and override options.

Lifecycle hooks

Lifecycle hooks manage session and agent state across the full session arc — from start through compaction to stop.
EventHandlerWhat it does
SessionStartsession-start.shDetects project state, checks map staleness
SessionStartmap-staleness.shChecks whether the codebase map needs a refresh
SessionStart (matcher: compact)post-compact.shVerifies critical context survived compaction
PreCompactcompaction-instructions.shInjects agent-specific compaction priorities
Stopsession-stop.shLogs session metrics, persists cost ledger
Stopagent-health.sh cleanupCleans up agent health markers on session end
UserPromptSubmitprompt-preflight.shPre-flight prompt validation
Notificationnotification-log.shLogs teammate communication

Health tracking hooks

Agent health hooks track the lifecycle of each teammate for monitoring and recovery.
EventHandlerWhat it does
SubagentStartagent-health.sh startRecords agent start event
SubagentStopagent-health.sh stopRecords agent stop event
TeammateIdleagent-health.sh idleRecords idle event for stuck-agent detection

Custom hooks via skills

Skills can register their own hook handlers through skill-hook-dispatch.sh. When a PostToolUse or PreToolUse event fires, the dispatcher checks for skill-specific hook scripts and calls them in sequence. To add a hook in a skill, define the handler script in your skill directory and register it in the skill manifest. The dispatcher resolves skill hooks from the plugin cache at runtime — no changes to hooks.json required.
Run /vbw:config with no arguments to see active skill-hook mappings alongside all other settings.

How hooks are resolved

Every hook command in hooks.json uses a multi-step resolution to find hook-wrapper.sh:
  1. Plugin cache (~/.claude/plugins/cache/vbw-marketplace/vbw/)
  2. CLAUDE_PLUGIN_ROOT environment variable (for --plugin-dir installs)
  3. /tmp/.vbw-plugin-root-link-*/ symlinks
  4. --plugin-dir from the running claude process arguments
If none of those paths resolve to an existing file, the hook exits 0 silently. This ensures VBW hooks never block a session when the plugin root is unavailable.

Build docs developers (and LLMs) love