ai-dev-lens
v5.4.3
Published
AI Lens — unified analytics dashboard for Claude Code, Codex, Cursor & Antigravity.
Maintainers
Readme
AI Dev Lens is a local-first, privacy-focused analytics dashboard that tracks your usage across multiple AI coding tools. It reads directly from local data directories — no cloud, no telemetry, no data ever leaves localhost.
Supported Tools
| Tool | Data Source | What's Tracked |
|------|------------|----------------|
| Claude Code (Anthropic) | ~/.claude/ | Sessions, costs, tokens, tool calls, MCP servers, projects, memory, plans |
| Codex CLI (OpenAI) | ~/.codex/ | Threads, token costs, projects, model usage, agent runs |
| Cursor | ~/.cursor/ | AI generations, composer sessions, mode tracking |
| VS Code (GitHub Copilot) | ~/.config/github-copilot/ | Chat sessions, subscription plan, feature flags |
| Kiro (Amazon) | ~/.kiro/ | Sessions, message counts |
| Gemini CLI | ~/.gemini/ | CLI sessions, message counts |
| Antigravity (Google) | ~/.gemini/antigravity/ | Conversations, brain artifacts, tracked projects, recordings |
Quick Start
Recommended — run directly with npx (no install needed):
npx ai-dev-lensOn first run it will:
- Ask your name to personalize the dashboard
- Install dependencies (~30 seconds, once)
- Start the server and open your browser at
localhost:3000
Custom Port
npx ai-dev-lens --port 4000Global Install
npm install -g ai-dev-lens
ai-dev-lens
ai-dev-lens --port 8080Using Yarn or pnpm
yarn dlx ai-dev-lens
pnpm dlx ai-dev-lensPages
Dashboard
- Activity heatmap (GitHub-style, last 365 days) with current + longest streaks
- Editor filter pills — click any editor to scope all charts to that tool
- KPI row: sessions, projects, tool calls, token I/O, cache hit rate, est. cost
- Token economy row: input, output, cache read/write, output/input ratio
- Modes doughnut — agent vs normal vs chat breakdown
- Monthly stacked bar trend by editor
- Peak hours + weekday pattern charts
- Conversation velocity (avg msgs/session over time)
- Top projects, top models, top tools ranking bars
- Large context warnings (sessions ≥ 200 or ≥ 500 messages flagged with AlertTriangle)
- Share Stats modal — shareable summary card
Sessions
- Full session table with search, sort (date/cost/tokens/messages), pagination
- Mode column — agent/normal/chat per session
- Bloat indicators — messages ≥ 500: red AlertTriangle; ≥ 200: amber AlertTriangle
- Large context KPI — count of sessions above threshold in header
- Session timeline — stacked AreaChart by editor, weekly grouped
- Modes horizontal bar chart — session count per mode
- Grouped-by-project view with editor color dots per project group
- Click any row to open full Chat Sidebar with turn-by-turn session replay
Projects
- Card grid (1/2/3 columns) with per-project stats: sessions, tokens, cost, editor, last active
- Activity bar (relative to max sessions across projects)
- Top 10 projects bar chart + editors doughnut + cost-by-project list
- Search + editor filter + date range filter
Costs
- Disclaimer banner — estimates based on public API list prices
- KPIs: total cost, avg/session, avg/day, models count, top model, top editor
- Cost by model donut + cost by editor donut + monthly trend line chart
- Cost by project horizontal bar chart (top 10)
- Model breakdown table: input/output/cache tokens, % of total, cost per model
- Most expensive sessions table — clickable rows open Chat Sidebar
- Unpriced models section — amber pills listing models with no pricing data
Tools (Deep Analysis)
- KPIs: sessions, messages (/session), tool calls (/session), tokens (/msg), est. cost
- Token flow: ProportionBar showing fresh input / cache write / cache read / output
- Efficiency section: output/input ratio, cache hit rate, tokens/msg, tools/session
- Clickable horizontal bar chart — click a tool to see drilldown with editors breakdown
- Date range + editor filters
MCPs
- 3 tabs: Servers | Tools | Sessions
- Server cards with expandable available-tools list and matched-calls table
- Charts: most used servers (stacked bar), most used tools (bar), servers by editor + transport (doughnuts)
- Never-used servers and tools sections
- Tools tab: full table with call counts, session counts, editor dots, server badge
- Sessions tab: sessions with MCP tool call counts and top tools pills
Compare
- Two editor dropdowns (A vs B) with side-by-side comparison
- Totals: sessions, tool calls, input/output/cache tokens with proportional bars
- Efficiency: avg tools/session, output/input ratio, cache hit rate, tokens/session
- Usage and token breakdown bar charts (grouped)
- Top tools side-by-side ranked lists
Artifacts
- 3-level collapsible tree: Project > Editor > File
- YAML frontmatter rendered as key-value table (status pills: completed/in_progress/pending/blocked)
- Markdown viewer with GFM task lists, syntax highlighting
- File metadata: lines, size, ~tokens, est. cost, last modified
- Raw/rendered toggle
GSD (Getting Stuff Done)
- Project phases from
.planning/directories - Phase progress bars, artifact viewers (plan/research/verification)
- FileSidebar for STATE.md and config.json
Subscriptions
- Per-editor cards with plan badge (Pro/Max/Plus/Free), status indicator
- CursorCard: plan, billing date, per-model request usage
- ClaudeCodeCard: 5-hour + 7-day limit bars with countdown timers
- CopilotCard: user login, feature pills (completion/chat/cli), quotas
- CodexCard: auth mode, user email, subscription dates
- Refresh button to re-read live config
Sessions (SQL Explorer)
- Run custom SQL against the unified session data
- Save and re-run queries
Data Sources
~/.claude/projects/**/*.jsonl Claude Code session logs
~/.claude/stats-cache.json Claude cached stats
~/.claude/settings.json Claude config + MCP servers
~/.codex/state_5.sqlite Codex thread metadata
~/.codex/sessions/**/*.jsonl Codex event logs
~/.cursor/ai-tracking/*.db Cursor AI code tracking
~/.cursor/ Cursor subscription data
~/.config/github-copilot/hosts.json GitHub Copilot auth
~/.kiro/ Kiro session data
~/.gemini/antigravity/ Antigravity brain artifacts
~/.planning/ GSD planning directoriesData auto-refreshes every 5–10 seconds via SWR polling. No background processes, no file watchers.
Tech Stack
- Next.js 16 with Turbopack
- React 19 with TypeScript
- Tailwind CSS 4 + shadcn/ui
- Recharts 3 — BarChart, AreaChart, LineChart, PieChart
- better-sqlite3 for SQLite databases (Codex, Cursor)
- SWR for client-side polling
- JetBrains Mono font
Configuration
User settings stored at ~/.ai-lens/config.json:
{
"userName": "Your Name",
"createdAt": "2025-01-01T00:00:00.000Z"
}Reset:
rm ~/.ai-lens/config.json && npx ai-dev-lensSecurity
- npm audit: 0 vulnerabilities
- Trivy scan: 0 vulnerabilities, 0 secrets, 0 misconfigurations
- All data stays on your machine — no external API calls, no telemetry
- SQLite databases opened read-only
- No credentials or tokens are read — only usage metadata
Requirements
- Node.js 18+ (LTS recommended)
- At least one supported AI tool installed with existing usage data
Troubleshooting
| Issue | Solution |
|-------|----------|
| Port already in use | npx ai-dev-lens --port 4000 |
| No data showing | Make sure you've used at least one AI tool so data files exist |
| Stale data | Wait for auto-refresh (5–10s) or reload the page |
| Reset name | rm ~/.ai-lens/config.json && npx ai-dev-lens |
| Slow first start | First run installs deps (~30s). Subsequent runs are instant |
| Claude shows $0 cost | Stats cache may be stale; dashboard computes cost directly from sessions |
What's New in v5.4.0
- Sessions: mode column (agent/normal/chat), bloat AlertTriangle indicators (≥200/≥500 msgs), large context KPI, stacked AreaChart timeline, editor dots in grouped view
- Costs: disclaimer banner, avg/day + avg/session KPIs, top model/editor KPIs, cost-by-project bar chart, most expensive sessions table, unpriced models list
- Subscriptions: full rewrite — per-editor cards with UsageBar, TimeUntil countdown, PlanBadge, FeaturePill; CursorCard, ClaudeCodeCard, CopilotCard, CodexCard renderers
- Dashboard: modes doughnut chart, top modes sidebar next to heatmap
Contributing
Found a bug or want to add support for another AI tool?
- Open an issue: github.com/komalSrinivasan/ai-lens/issues
- Pull requests welcome
Adding a new tool requires:
- A new adapter in
lib/adapters/ - API routes in
app/api/unified/ - Integration in unified pages (sessions, projects, costs, dashboard)
Author & Maintainer
Komal Vardhan Lolugu Lead Product Engineer — Agentic AI & Generative Models
| Platform | Link | |----------|------| | Portfolio | komalsrinivas.vercel.app | | LinkedIn | linkedin.com/in/komalvardhanlolugu | | GitHub | github.com/komalSrinivasan | | Medium | komalvardhan.medium.com | | Topmate | topmate.io/komal_vardhan_lolugu |
For bugs, questions, or collaboration — reach out via LinkedIn or Topmate.
License
MIT
