Claude Dev Insights¶
Comprehensive developer analytics and productivity insights for Claude Code.
Automatically track sessions, enforce security policies, guard against cost overruns, and ensure code quality with 4 intelligent hooks.
Features at a Glance¶
📊 Session Analytics¶
Track every Claude Code session with 28 data points including duration, messages, tokens, costs, and tool usage. Export to CSV and optionally sync to Google Sheets for team collaboration.
🔒 Security Scanner¶
Block access to sensitive files (.env, *.key, credentials), detect dangerous commands (rm -rf, chmod 777), and maintain a security audit trail.
💰 Cost Guard¶
Track session costs in real-time, set budget limits, and get warnings before exceeding spending thresholds. Monitor expensive operations like WebSearch and WebFetch.
✅ Quality Automator¶
Automatically run linters after file edits (PHPCS, ESLint, Stylelint, Flake8), validate commit messages, and maintain code quality standards.
Quick Install¶
# Inside Claude Code CLI
/plugin marketplace add kanopi/claude-toolbox
/plugin install claude-dev-insights@claude-toolbox
That's it! All hooks activate automatically when the plugin is enabled.
What Gets Tracked¶
Every session logs to ~/.claude/session-logs/sessions.csv with:
- Session metadata: Timestamp, ID, project name, summary, end reason
- Duration: Wall-clock time from start to end (seconds)
- Activity: User messages, assistant messages
- Tokens: Input, output, cache read, cache write, total
- Cost: Estimated USD based on Claude Sonnet 4.5 pricing
- Tools: Tool call counts, API time, average call time, top 5 tools
- Context: Git branch, Claude Code version, permission mode
- Environment: CMS type, environment type, dependencies
Hook Feedback¶
The PreToolUse and PostToolUse hooks can provide feedback when they block operations or detect issues:
Security Block:
🔒 BLOCKED: Access to sensitive file '.env'
This file matches a security pattern and cannot be accessed.
Cost Warning:
💰 COST WARNING: Session approaching budget limit
Tool: WebSearch (expensive operation)
Quality Violation:
⚠️ Code Quality Warning: src/api.php
Linter: phpcs
Line 42: Missing function docblock
Note: SessionStart and SessionEnd hooks log data in the background. Check ~/.claude/session-logs/sessions.csv to view your session history.
Privacy & Security¶
What's logged:
✅ Session metadata (timestamps, IDs, duration) ✅ Usage statistics (tokens, costs, tool counts) ✅ Session summary (one-line description) ✅ Security events (blocked operations) ✅ Quality events (linter results)
NOT logged:
❌ Actual code or conversation content ❌ Sensitive data or credentials ❌ File contents or API responses
All data stays on your machine unless you explicitly configure Google Sheets sync.
Requirements¶
Required:
- Claude Code CLI
- jq (JSON parsing)
- macOS: brew install jq
- Linux: apt-get install jq
Optional:
- Python 3 + gspread + oauth2client (for Google Sheets sync)
- Linters (PHPCS, ESLint, etc.) for quality automation
Next Steps¶
- Installation Guide - Get up and running in 5 minutes
- Quick Start - Learn the basics
- Configuration - Customize security, cost, and quality rules
- Google Sheets Setup - Enable cloud sync
Support¶
- Issues: GitHub Issues
- Source Code: GitHub Repository
Created and maintained by Kanopi Studios