codeflash/.claude/hooks/track-read.sh
Kevin Turcios 5cb0a44cce chore: fix claude hooks and add LSP tool env
- bash-guard: block awk (was missing from blocked commands)
- post-compact: replace fragile sed JSON escaping with jq -n --arg
- track-read: deduplicate entries before appending to .read-tracker
- settings: remove redundant Edit→require-read hook (built-in handles it)
- settings: add ENABLE_LSP_TOOL=1 for inline LSP diagnostics
2026-04-23 05:08:37 -05:00

11 lines
379 B
Bash
Executable file

#!/usr/bin/env bash
# PostToolUse hook: Track Read calls for the require-read guard.
INPUT=$(cat 2>/dev/null || true)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null || true)
[ -z "$FILE_PATH" ] && exit 0
TRACKER="$CLAUDE_PROJECT_DIR/.claude/.read-tracker"
grep -qxF "$FILE_PATH" "$TRACKER" 2>/dev/null || echo "$FILE_PATH" >> "$TRACKER"
exit 0