Plugin settings and state
Plugins often need per-project configuration. The plugin-dev toolkit's pattern: a .claude/<plugin-name>.local.md file with YAML frontmatter for machine-readable settings and a markdown body for human notes — gitignored, validated by scripts, updated atomically.
---enabled: truestrict_mode: falsemax_retries: 3notify_channel: "#eng-alerts"---
# My Plugin — local settings
Strict mode is off while we migrate the legacy API routes.Flip it on after PROJ-142 lands.Hooks read these settings by parsing the frontmatter with sed/awk/grep and can exit early when disabled — the temporarily-active-hook pattern: a flag file or config check at the top of the script makes a hook a no-op until enabled.
#!/bin/bashFLAG_FILE="$CLAUDE_PROJECT_DIR/.enable-strict-validation"
if [ ! -f "$FLAG_FILE" ]; then exit 0 # not enabled — skip silentlyfi
input=$(cat)# ... validation logic ...Check your understanding
Section titled “Check your understanding”Question 1What is the "temporarily active hook" pattern?
A quick exit at the top makes the hook a cheap no-op until explicitly enabled.