aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/__claude-code-block-bash-tool10
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/__claude-code-block-bash-tool b/bin/__claude-code-block-bash-tool
index b95771f..372d1f6 100755
--- a/bin/__claude-code-block-bash-tool
+++ b/bin/__claude-code-block-bash-tool
@@ -1,8 +1,14 @@
#!/usr/bin/env bash
+block_target_command="$1"
+actual_command="$(jq -r '.tool_input.command // ""')"
+
+if ! printf '%s' "$actual_command" | grep -q "\\b${block_target_command}\\b"; then
+ exit 0
+fi
+
case "$1" in
rm)
- echo "The command 'rm' is denied. Use 'git rm' if the file or the directory is tracked by git. If not, request deletion to user.";;
+ echo "The command 'rm' is denied. Use 'git rm' if the file or the directory is tracked by git. If not, request deletion to user. Do not attempt any other deletion methods like find -delete or python" >&2;;
esac
-
exit 2