examples/startup-hooks/README.md
This directory contains startup hook scripts that help AI agents automatically detect and adapt to changes in their environment.
Purpose: Automatically detect bd (beads) upgrades and show what changed
Features:
bd info --whats-new output automatically.beads/metadata.jsonUsage:
# Source the script at session start (recommended)
source examples/startup-hooks/bd-version-check.sh
# Or execute it directly
bash examples/startup-hooks/bd-version-check.sh
If Claude Code supports startup hooks:
# Add to .claude/hooks/session-start
source examples/startup-hooks/bd-version-check.sh
Alternatively, manually run at the start of each coding session.
Add to your shell initialization file:
# ~/.bashrc or ~/.zshrc
# Run bd version check when entering a beads project
if [ -d ".beads" ]; then
source /path/to/beads/examples/startup-hooks/bd-version-check.sh
fi
Add to workspace settings or your shell init file following the same pattern as GitHub Copilot.
Any AI coding environment that allows custom startup scripts can source this file.
brew install jq on macOS, apt-get install jq on Ubuntu).beads/metadata.jsonmetadata.json with current version for next session🔄 bd upgraded: 0.23.0 → 0.24.2
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🆕 What's New in bd (Current: v0.24.2)
=============================================================
## v0.24.2 (2025-11-23)
• New feature X
• Bug fix Y
• Performance improvement Z
[... rest of what's new output ...]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 Review changes above and adapt your workflow accordingly
🔧 Git hooks outdated. Updating to match bd v0.24.2...
✓ Git hooks updated successfully
Q: Script doesn't detect version change
A: Check that .beads/metadata.json exists and contains last_bd_version field
Q: "jq not found" warning
A: Install jq: brew install jq (macOS) or apt-get install jq (Ubuntu)
Q: Git hooks not auto-updating
A: Ensure you have write permissions to .git/hooks/ directory