Developer analytics and productivity insights for Claude Code. Automatically track sessions with detailed metrics and optional Google Sheets sync using 3 intelligent hooks.
- 29 data points per session - Duration, messages, tokens, costs, tool usage
- Local CSV storage -
~/.claude/session-logs/sessions.csv - Google Sheets sync - Optional cloud backup for team sharing
- Environment profiling - CMS detection, dependency tracking, git status
- Ticket tracking - Auto-detect and log issue/ticket numbers
- Session summaries - Describe what you're working on
Via Claude Toolbox Marketplace:
# Inside Claude Code CLI
/plugin marketplace add kanopi/claude-toolbox
/plugin install claude-dev-insights@claude-toolboxDirect Install:
# Inside Claude Code CLI
/plugin install https://github.com/kanopi/claude-dev-insightsThat's it! Hooks activate automatically when the plugin is enabled.
Track your work with structured commands at the start of your message:
Use #ticket: to log issue/ticket numbers:
#ticket: JIRA-1234
#ticket: JIRA-1234 GH-567 # Multiple tickets
#ticket: ABC-999 # Add more later
Use #topic: to describe what you're working on:
#topic: feat: Adding user authentication
#topic: fix: Resolving checkout bug
#topic: refactor: Optimizing database queries
Set ticket and topic together:
#ticket: JIRA-1234 #topic: feat: Adding dark mode to dashboard
All data is logged to CSV for easy reporting:
grep JIRA-1234 ~/.claude/session-logs/sessions.csv| Column | Description | Example |
|---|---|---|
timestamp |
Session end timestamp | 2025-11-12 08:45:23 |
session_id |
Unique session identifier | abc123def456 |
user |
Git user name or system username | John Doe |
ticket_number |
Optional ticket/issue number | JIRA-1234 |
project |
Project directory name | my-project |
summary |
One-line session description | Feature: User Auth |
cms_type |
Detected CMS (drupal/wordpress/unknown) | drupal |
environment_type |
Environment (ddev/local) | ddev |
dependencies_count |
Number of composer dependencies | 47 |
uncommitted_changes |
Number of uncommitted files at start | 3 |
source |
Session source (new/resume) | new |
end_reason |
How session ended (clear/crash/etc) | clear |
duration_seconds |
Session duration in seconds | 1847 |
user_messages |
Number of user messages | 45 |
assistant_messages |
Number of assistant messages | 62 |
input_tokens |
Tokens sent to API | 18943 |
output_tokens |
Tokens generated by API | 12561 |
cache_read_tokens |
Tokens read from cache | 2841023 |
cache_write_tokens |
Tokens written to cache | 198234 |
total_tokens |
Sum of all token types | 3070761 |
total_cost |
Session cost in USD | 2.1847 |
tool_calls |
Number of tool invocations | 38 |
api_time_seconds |
Total API time in seconds | 47 |
avg_call_time_ms |
Average API call time in ms | 1237 |
tools_used |
Top 5 tools with counts | Bash:12; Read:10; Edit:8 |
git_branch |
Active git branch | main |
claude_version |
Claude Code version | 2.0.36 |
model |
AI model used | claude-sonnet-4-5-20250929 |
permission_mode |
Permission mode setting | default |
- βοΈ Cloud backup - Your data is safe in the cloud
- π₯ Team sharing - Share insights with your team
- π Easy visualization - Built-in charts and pivot tables
- π± Access anywhere - View on any device
- π Real-time sync - Data updates automatically
-
Install Python dependencies:
pip3 install gspread oauth2client
-
Run interactive setup:
python3 ~/.claude/plugins/cache/claude-dev-insights/hooks/session-end/sync-to-google-sheets.py --setup -
Test connection:
python3 ~/.claude/plugins/cache/claude-dev-insights/hooks/session-end/sync-to-google-sheets.py --test
Full setup guide: docs/google-sheets/setup.md
# View all sessions
cat ~/.claude/session-logs/sessions.csv
# Calculate total cost
awk -F, 'NR>1 {sum+=$14} END {print "Total: $"sum}' ~/.claude/session-logs/sessions.csv
# Cost by project
awk -F, 'NR>1 {cost[$3]+=$14} END {for(p in cost) print p": $"cost[p]}' ~/.claude/session-logs/sessions.csv
# Generate full report
python3 ~/.claude/plugins/cache/claude-dev-insights/lib/analytics.py markdown- β Session metadata (timestamps, IDs, duration)
- β Usage statistics (tokens, costs, tool counts)
- β Session summary (one-line description)
- β Ticket numbers (for issue tracking)
- β Not logged: Actual code, conversation content, sensitive data
- Local CSV:
~/.claude/session-logs/sessions.csv(your machine only) - Google Sheets: Only if you explicitly configure it
If using Google Sheets:
- Protect credentials - Keep service account keys private
- Set permissions - Only share sheets with trusted team members
- Use dedicated account - Create service account specifically for this
- Rotate keys - Regularly update service account keys
- Claude Code CLI - To run the plugin
- jq - JSON parsing (usually pre-installed on macOS/Linux)
- macOS:
brew install jq - Linux:
apt-get install jq
- macOS:
- Python 3 - For Google Sheets sync and analytics reports
- gspread, oauth2client -
pip3 install gspread oauth2client
GPL-2.0-or-later - see LICENSE.md file for details.
Full documentation is available at https://kanopi.github.io/claude-dev-insights/
- Issues: GitHub Issues
- Source Code: GitHub Repository
Created and maintained by Kanopi Studios