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.
82 lines
2.1 KiB
Markdown
82 lines
2.1 KiB
Markdown
# Claude Code Usage Tracking System
|
|
|
|
Track and analyze your Claude Code usage across all projects.
|
|
|
|
## Quick Setup
|
|
|
|
1. **Install the tracking hooks:**
|
|
```bash
|
|
python3 ~/.claude/scripts/setup-usage-tracking.py
|
|
```
|
|
|
|
This writes hook overrides to `~/.claude/settings.local.json` and regenerates `~/.claude/settings.json` via `claude-settings-merge`.
|
|
|
|
2. **Restart Claude Code** for hooks to take effect
|
|
|
|
3. **View your usage:**
|
|
```bash
|
|
# 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
|
|
|
|
```bash
|
|
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
|
|
|
|
1. **Hooks not working?**
|
|
- Check that `~/.claude/settings.json` contains the hook entries (rerun `setup-usage-tracking.py` if not)
|
|
- Restart Claude Code so it re-reads settings
|
|
- Run with `--debug` flag
|
|
|
|
2. **No data showing?**
|
|
- Ensure hooks are installed
|
|
- Check if database exists: `ls ~/.claude/usage-tracking.db`
|
|
- Verify script permissions
|
|
|
|
3. **Reset tracking:**
|
|
```bash
|
|
rm ~/.claude/usage-tracking.db
|
|
rm -rf ~/.claude/usage-logs/
|
|
```
|