From 73ef292bd9913e8bcab3c67fa50c350be35262ce Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Fri, 20 Mar 2026 21:54:39 +0200 Subject: [PATCH] feat(claude): block edits to submodule paths in pre-edit hook --- .claude/hooks/pre-edit-block.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.claude/hooks/pre-edit-block.sh b/.claude/hooks/pre-edit-block.sh index 6ae9299..4bc027b 100755 --- a/.claude/hooks/pre-edit-block.sh +++ b/.claude/hooks/pre-edit-block.sh @@ -10,6 +10,18 @@ case "$fp" in echo "BLOCKED: $fp is a vendor/lock file — do not edit directly" >&2 exit 2 ;; + */tools/dotbot/* | */tools/dotbot-include/* | */tools/antidote/*) + echo "BLOCKED: $fp is inside a git submodule — do not edit" >&2 + exit 2 + ;; + */config/tmux/plugins/*) + echo "BLOCKED: $fp is a tmux plugin submodule — do not edit" >&2 + exit 2 + ;; + */config/cheat/cheatsheets/community/* | */config/cheat/cheatsheets/tldr/*) + echo "BLOCKED: $fp is a cheat submodule — do not edit" >&2 + exit 2 + ;; */secrets.d/*.fish) case "$(basename "$fp")" in *.example.fish | *.fish.example) exit 0 ;;