Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .claude/hooks/bash-guard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ case "$FIRST_CMD" in
echo "BLOCKED: Use the Read tool instead of \`$FIRST_CMD\`. Read provides line numbers and supports images/PDFs." >&2
exit 2
;;
awk)
echo "BLOCKED: Use the Grep tool or Read tool instead of \`awk\`." >&2
exit 2
;;
sed)
if echo "$COMMAND" | grep -qE '(^|[[:space:]])sed[[:space:]]+-i'; then
echo "BLOCKED: Use the Edit tool instead of \`sed -i\`. Edit tracks changes properly." >&2
Expand Down
8 changes: 3 additions & 5 deletions .claude/hooks/post-compact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ STATE="${STATE}- libcst for code transforms, ast for read-only analysis\n"

[ -z "$STATE" ] && exit 0

cat <<EOF
{
"systemMessage": "PRESERVE the following session state through compaction:\n$(echo -e "$STATE" | sed 's/"/\\"/g' | sed ':a;N;$!ba;s/\n/\\n/g')"
}
EOF
EXPANDED=$(printf '%b' "$STATE")
jq -n --arg msg "PRESERVE the following session state through compaction:
$EXPANDED" '{"systemMessage": $msg}'

exit 0
3 changes: 2 additions & 1 deletion .claude/hooks/track-read.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty' 2>/dev/null |

[ -z "$FILE_PATH" ] && exit 0

echo "$FILE_PATH" >> "$CLAUDE_PROJECT_DIR/.claude/.read-tracker"
TRACKER="$CLAUDE_PROJECT_DIR/.claude/.read-tracker"
grep -qxF "$FILE_PATH" "$TRACKER" 2>/dev/null || echo "$FILE_PATH" >> "$TRACKER"
exit 0
15 changes: 4 additions & 11 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@
"timeout": 5
}
]
},
{
"matcher": "Edit",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/require-read.sh",
"timeout": 5
}
]
}
],
"PostToolUse": [
Expand Down Expand Up @@ -92,5 +82,8 @@
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/status-line.sh"
},
"enableAllProjectMcpServers": true
"enableAllProjectMcpServers": true,
"env": {
"ENABLE_LSP_TOOL": "1"
}
}
Loading