Skip to content

buildingopen/hook-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hook-stats

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

Install

curl -fsSL https://raw.githubusercontent.com/buildingopen/hook-stats/main/hook-stats -o ~/.local/bin/hook-stats
chmod +x ~/.local/bin/hook-stats

Prerequisites

Requires 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.

How it works

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

Requirements

  • The bash audit log hook (see Prerequisites)

License

MIT

About

Analyze your Claude Code bash command log.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages