Initial commit: Fresh start with current state
This commit is contained in:
15
.claude/hooks/pre-bash.sh
Normal file
15
.claude/hooks/pre-bash.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# PreToolUse Hook for Bash - Logs bash commands before execution
|
||||
|
||||
# Extract the bash command from CLAUDE_TOOL_PARAMETERS if available
|
||||
COMMAND="${CLAUDE_TOOL_PARAMETERS:-Unknown command}"
|
||||
|
||||
# Log the command
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Executing: $COMMAND" >> .claude/logs/bash.log
|
||||
|
||||
# Optional: Add safety checks
|
||||
# Example: Block dangerous commands
|
||||
if echo "$COMMAND" | grep -qE "rm -rf /|mkfs|dd if="; then
|
||||
echo "WARNING: Potentially dangerous command blocked!" >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user