mirror of
https://github.com/alleneubank/claude-code.git
synced 2026-09-14 14:06:56 +08:00
f3c1789eed
Rewrite README.md to make this repo presentable for open-source consumers who don't have the surrounding private dotfiles tree. Inventory every directory (commands, agents, all 25 skills, plugins, statusline, scripts, settings, hooks, analytics) with accurate descriptions, document the plugin marketplace install path, and add an explicit footnote about the optional dotfiles-tree relationship. install.sh now also symlinks commands/, agents/, and .claude/skills/ into ~/.claude/, and prefers the parent dotfiles' codex/codex.json when present but falls back to a new in-repo codex.json sample so standalone clones no longer fail under set -e. Remove the stale TODO.md (DuckDB indexing work, all items completed) and untrack CLAUDE.local.md / AGENTS.local.md so personal notes stay private on disk via .gitignore. Drop a personal ~/dotfiles path from scripts/README.md.
2.1 KiB
2.1 KiB
Claude Code Usage Tracking System
Track and analyze your Claude Code usage across all projects.
Quick Setup
-
Install the tracking hooks:
python3 ~/.claude/scripts/setup-usage-tracking.pyThis writes hook overrides to
~/.claude/settings.local.jsonand regenerates~/.claude/settings.jsonviaclaude-settings-merge. -
Restart Claude Code for hooks to take effect
-
View your usage:
# Summary statistics python3 ~/.claude/scripts/analyze-usage.py --summary # Last 30 days python3 ~/.claude/scripts/analyze-usage.py --summary --days 30 # Command history python3 ~/.claude/scripts/analyze-usage.py --commands # Session details python3 ~/.claude/scripts/analyze-usage.py --sessions # Live dashboard python3 ~/.claude/scripts/usage-dashboard.py
What Gets Tracked
- Session Data: Start/end times, duration, project paths
- Tool Usage: Every tool invocation with timestamps
- Commands: All Bash commands with descriptions
- Projects: Time spent per project
- Events: Notifications, stops, subagent activity
Data Storage
- SQLite Database:
~/.claude/usage-tracking.db - JSON Logs:
~/.claude/usage-logs/YYYY-MM-DD.jsonl
Export Data
python3 ~/.claude/scripts/analyze-usage.py --export my-usage-data.json
Privacy
All data is stored locally on your machine. Nothing is sent externally.
Customization
Edit ~/.claude/scripts/usage-tracker.py to:
- Add custom tracking logic
- Filter sensitive data
- Change storage locations
- Add new metrics
Troubleshooting
-
Hooks not working?
- Check that
~/.claude/settings.jsoncontains the hook entries (rerunsetup-usage-tracking.pyif not) - Restart Claude Code so it re-reads settings
- Run with
--debugflag
- Check that
-
No data showing?
- Ensure hooks are installed
- Check if database exists:
ls ~/.claude/usage-tracking.db - Verify script permissions
-
Reset tracking:
rm ~/.claude/usage-tracking.db rm -rf ~/.claude/usage-logs/