Changes for Claude Code resources

This commit is contained in:
Cole Medin
2025-08-06 09:44:59 -05:00
parent 5597e61d36
commit 4e1240a0b3
5 changed files with 5 additions and 86 deletions

View File

@@ -2,24 +2,13 @@
# PostToolUse hook: Log all tool usage for tracking and debugging
# This hook runs after any tool execution to maintain an audit log
# Read the JSON input from stdin
input=$(cat)
# Extract tool name and basic info
tool_name=$(echo "$input" | jq -r '.tool_name // "unknown"')
timestamp=$(date '+%Y-%m-%d %H:%M:%S')
# Create logs directory if it doesn't exist
mkdir -p .claude/logs
# Log the tool usage
echo "[$timestamp] Tool used: $tool_name" >> .claude/logs/tool-usage.log
# Optionally, you can add more detailed logging
if [[ "$tool_name" =~ ^(Edit|Write|MultiEdit)$ ]]; then
file_path=$(echo "$input" | jq -r '.tool_input.file_path // "unknown"')
echo "[$timestamp] File operation: $tool_name on $file_path" >> .claude/logs/file-operations.log
fi
echo "[$timestamp] Claude made an edit " >> .claude/logs/tool-usage.log
# Always return success to avoid blocking tools
echo "{}"