refactor(claude): migrate hooks to external scripts and add new hooks

Replace inline command strings in settings.json with external scripts
in .claude/hooks/ for readability and maintainability. Consolidate
three PostToolUse formatters into one script and add markdown/yaml
formatting. Add new hooks: SessionStart context banner, Stop lint
gate, async Bats test runner, idle desktop notification, and
PostToolUseFailure logger.
This commit is contained in:
2026-03-20 04:38:18 +02:00
parent 2b867c3348
commit cff83e4738
8 changed files with 173 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# SessionStart context: print branch, dirty file count, and last commit.
cd "$CLAUDE_PROJECT_DIR" || exit 0
branch=$(git branch --show-current 2> /dev/null)
dirty=$(git status --short 2> /dev/null | wc -l | tr -d ' ')
last=$(git log -1 --oneline 2> /dev/null)
echo "=== Dotfiles session context ==="
echo "Branch : ${branch:-unknown}"
echo "Dirty : ${dirty} file(s)"
echo "Last : ${last}"
exit 0