Analyze your Claude Code bash command log. See what commands are running, how often, and when.
$ hook-stats
Bash Command Stats
===================
Total commands: 926
Today: 284
Top 15 commands:
247 ssh
85 python3
70 gh
66 grep
61 sleep
40 sqlite3
35 cd
Git operations:
pushes: 6
commits: 16
diffs: 3
Commands per day (last 7):
2026-03-19: 632
2026-03-20: 284
curl -fsSL https://raw.githubusercontent.com/buildingopen/hook-stats/main/hook-stats -o ~/.local/bin/hook-stats
chmod +x ~/.local/bin/hook-statsRequires the bash audit log hook in your Claude Code settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "jq -r '\"[\" + (now | todate) + \"] \" + (.tool_input.command // \"?\")' >> ~/.claude/bash-commands.log"
}
]
}
]
}
}This logs every bash command Claude runs with a timestamp to ~/.claude/bash-commands.log.
Parses ~/.claude/bash-commands.log (timestamped lines only, skips multi-line command fragments) and shows:
- Total commands and today's count
- Top 15 most frequent commands
- Git operation counts (push, commit, diff)
- Daily activity for the last 7 days
- The bash audit log hook (see Prerequisites)
MIT