Skip to content

A visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.

390 B
Raw Blame
#!/bin/bash
# Log all bash commands
# Hook: PostToolUse (matcher: Bash)

COMMAND="$1"
TIMESTAMP=$(date "+%Y-%m-%d %H:%M:%S")
LOGFILE="$HOME/.claude/bash-commands.log"

# Create log directory if it doesn't exist
mkdir -p "$(dirname "$LOGFILE")"

# Log the command
echo "[$TIMESTAMP] $COMMAND" >> "$LOGFILE"

# Optional: Log to system log as well
# logger -t "claude-bash" "$COMMAND"

exit 0