By iftrueco
Tracks prompt iterations, sessions, time, and optional prompts per git branch
A Claude Code plugin that tracks per-branch AI usage statistics — session counts, iterations, timing, and optional prompt capture.
git clone <repo-url> && cd branch-tracker
claude --plugin-dir /path/to/branch-tracker
git clone <repo-url> && cd branch-tracker
bash install.sh
claude --plugin-dir ~/.claude/plugins/branch-tracker
Optionally create ~/.claude/plugins/branch-tracker/config.json:
{
"webhook_url": "https://your-server.com/api/claude-stats",
"webhook_token": "your-secret-token",
"capture_prompts": false
}
| Key | Description | Default |
|---|---|---|
webhook_url | POST destination for session data | (none) |
webhook_token | Bearer token for webhook auth | (none) |
capture_prompts | Record user prompts to prompts.jsonl | false |
Ask Claude about your branch stats:
Or use the skill directly: /branch-stats
All data is stored in ~/.claude/plugins/branch-tracker/data/.
One line per Claude Code stop event:
{
"timestamp": "2026-03-19T15:30:00+00:00",
"session_id": "abc123",
"repo": "my-app",
"branch": "main",
"cwd": "/Users/you/code/my-app"
}
One line per user prompt (only when capture_prompts: true):
{
"timestamp": "2026-03-19T15:30:00+00:00",
"session_id": "abc123",
"repo": "my-app",
"branch": "main",
"prompt": "Fix the login bug"
}
Append-only log of any errors encountered by the hook script. The hook never blocks Claude Code — errors are logged silently.
The report groups sessions by repository and branch:
Repository Branch Sessions Iters First Seen Last Seen Duration
────────── ────────── ──────── ───── ────────── ────────── ────────
my-app main 5 23 2026-03-15 2026-03-19 4d 0h
my-app feat/auth 3 12 2026-03-17 2026-03-19 2d 0h
Run directly:
python3 ~/.claude/plugins/branch-tracker/scripts/report.py
python3 ~/.claude/plugins/branch-tracker/scripts/report.py --branch feat
python3 ~/.claude/plugins/branch-tracker/scripts/report.py --repo my-app
datetime.fromisoformat)git branch --show-current)Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub iftrueco/claude-branch-tracker --plugin branch-trackerQuery your Claude Code history with SQL. Analyze conversations, commits, and productivity patterns.
Tracks Claude Code session usage (tokens, costs, skills, MCP, subagents) and sends data to a self-hosted dashboard.
Automatic branch-specific CLAUDE.md memory management. Switches your Claude Code context when you change git branches.
Live API usage in Claude Code statusline - colored progress bars, Git info, tokens, session metrics, device tracking, and more
Session analytics hook for Claude Code — 15 configurable sections (models, cost, cache, tools, files, git diff, RTK savings...)
Live usage status bar for Claude Code — session limits, weekly usage, lines changed, 10 themes, widget priorities, shimmer animations, and zero API calls