chore: fix UBS hook stdin parsing and update beads

.claude/hooks/on-file-write.sh:
- Fix hook to read Claude Code context from JSON stdin (FILE_PATH and
  CWD extracted via jq) instead of relying on environment variables
- Scan only the changed file instead of the entire project directory,
  reducing hook execution from ~30s to <1s per save

.beads/:
- Sync issue tracker state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Taylor Eernisse
2026-02-11 08:12:34 -05:00
parent 2c9de1a6c3
commit f5967a8e52
3 changed files with 30 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
bd-3qn6 bd-3hjh

View File

@@ -1,6 +1,11 @@
#!/bin/bash #!/bin/bash
# Ultimate Bug Scanner - Claude Code Hook # Ultimate Bug Scanner - Claude Code Hook
# Runs on every file save for UBS-supported languages (JS/TS, Python, C/C++, Rust, Go, Java, Ruby) # Runs on every file save for UBS-supported languages (JS/TS, Python, C/C++, Rust, Go, Java, Ruby)
# Claude Code hooks receive context as JSON on stdin.
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
CWD=$(echo "$INPUT" | jq -r '.cwd // empty')
if [[ "$FILE_PATH" =~ \.(js|jsx|ts|tsx|mjs|cjs|py|pyw|pyi|c|cc|cpp|cxx|h|hh|hpp|hxx|rs|go|java|rb)$ ]]; then if [[ "$FILE_PATH" =~ \.(js|jsx|ts|tsx|mjs|cjs|py|pyw|pyi|c|cc|cpp|cxx|h|hh|hpp|hxx|rs|go|java|rb)$ ]]; then
echo "🔬 Running bug scanner..." echo "🔬 Running bug scanner..."
@@ -8,5 +13,5 @@ if [[ "$FILE_PATH" =~ \.(js|jsx|ts|tsx|mjs|cjs|py|pyw|pyi|c|cc|cpp|cxx|h|hh|hpp|
echo "⚠️ 'ubs' not found in PATH; install it before using this hook." >&2 echo "⚠️ 'ubs' not found in PATH; install it before using this hook." >&2
exit 0 exit 0
fi fi
ubs "${PROJECT_DIR}" --ci 2>&1 | head -50 ubs "$FILE_PATH" --ci 2>&1 | head -50
fi fi