Claude Code Analytics Automation
Daily automated extraction of Claude Code “Lines this month” per team member from claude.ai/analytics/claude-code, saved as a dated CSV and delivered as a Gmail draft summary.
Core Idea
The Claude admin console tracks lines of code generated per team member (MTD reset). A Cowork scheduled task extracts this daily via browser automation (Export CSV intercept), saves a dated file to the Analytics folder, and creates a Gmail draft for the CTO to review. Provides ongoing visibility into team AI adoption without manual effort.
Key Points
- Schedule: Daily at 8:01 AM via Cowork scheduled task
claude-code-analytics-daily - Method: Navigate to
claude.ai/analytics/claude-code→ click Export → intercept CSV in-browser - Output CSV:
D:\OneDrive\Work\80.BOL\03. Service Operation\IT Operation\Claude Subscription\Analytics\YYYYMMDD.csv - Gmail draft: Auto-created with ranked member table (sorted by lines descending)
- Team size: 23 members at BOL
- Metric: “Lines this month” — MTD, resets each calendar month
May 2026 Baseline (as of 2026-05-23)
| Rank | Member | Lines (MTD) |
|---|---|---|
| 1 | kraitheps@bol.co.th | 32,438 |
| 2 | phuriwajr@bol.co.th | 29,776 |
| 3 | noppawits@bol.co.th | 29,665 |
| — | Team total (23 members) | ~259,606 |
| — | Suggestion accept rate | 97.7% |
Technical Notes
- Export button CSV intercept is more reliable than pagination-based scraping
- The Cowork sandbox D: drive is inaccessible by default — requires the Analytics folder to be connected as a Cowork workspace folder for direct saves
- If folder access is lost, task falls back to saving in outputs folder with a manual move step
- Claude in Chrome must be connected for the task to run
Week of 2026-W21
Pipeline set up from scratch: task created, tested, export method simplified (pagination → Export intercept), Analytics folder connected. Daily CSVs now saving automatically. Gmail draft creation confirmed. Historical baseline established for May 2026.
Source
Journal dates: 2026-W21 (sessions: “Team member code metrics”, “Claude code analytics daily” ×3)