mirror of
https://github.com/bitwarden/server.git
synced 2026-05-31 16:17:04 -05:00
Claude Code Hooks
All hooks are Stop hooks — they fire when Claude finishes responding and check whether documentation or references need updating based on what was changed.
Configuration
Register hooks in .claude/settings.local.json — not settings.json. Local settings are gitignored, keeping your personal hook configuration out of source control.
Requirements
jqmust be installed (brew install jq)- Must be run from within a git repository
Testing & Debugging
- Verbose mode: Press
Ctrl+Oin Claude Code to see hook execution details - Debug mode: Run
claude --debugfor full execution logging
Disabling
- Use the
/hooksmenu in Claude Code to toggle individual hooks - Or set
"disableAllHooks": truein.claude/settings.local.json
seeder-docs-check.sh
Event: Stop
Purpose: Reminds developers to update Seeder documentation when code in
util/Seeder/, util/SeederApi/, or util/SeederUtility/ was modified but no
.md files in those directories were touched.
How it works:
- Runs
git diffto detect all changed files - If non-markdown files were changed under a Seeder project AND no
.mdfiles in any of the three Seeder projects were modified, blocks the stop with a reminder (intentionally cross-project — a doc update anywhere in the Seeder subsystem satisfies the check) - The reminder lists all
.mdfiles in the affected projects (discovered dynamically) - On the next stop,
stop_hook_activeis true, so the hook allows through - Result: one reminder per stop, then the developer decides
rust-sdk-surface-check.sh
Event: Stop
Purpose: Ensures the RustSdk API surface reference stays current when the
sdk-internal dependency rev is bumped. Prevents .claude/skills/bump-rust-sdk/references/api-surface.md
from going stale.
How it works:
- Runs
git diffto detect all changed files - If
util/RustSdk/rust/Cargo.tomlwas modified BUT.claude/skills/bump-rust-sdk/references/api-surface.mdwas NOT, blocks the stop with a reminder to regenerate the API surface inventory - On the next stop,
stop_hook_activeis true, so the hook allows through - Result: one reminder per stop — Claude reads the
.rssource files and regenerates the reference