Agentlytics

Unified analytics for your AI coding agents

Cursor · Windsurf · Claude Code · VS Code · Zed · Antigravity · OpenCode · Codex · Gemini CLI · Copilot CLI · Cursor Agent · Command Code

npm editors license node
$ npx agentlytics
Agentlytics dashboard

Features

Everything you need to understand your AI coding workflows.

📊 Dashboard
KPIs, activity heatmap, editor breakdown, coding streaks, token economy, peak hours, top models & tools.
💬 Sessions
Search, filter, full conversation viewer with syntax highlighting and diff views.
📁 Projects
Per-project analytics: sessions, messages, tokens, models, editor breakdown.
🔬 Deep Analysis
Tool frequency, model distribution, token breakdown with drill-down.
⚖️ Compare
Side-by-side editor comparison with efficiency ratios.
📡 Relay
Multi-user session sharing with MCP server for cross-team AI session querying.

Quick Start

One command. No config. No data leaves your machine.

$ npx agentlytics

Opens at http://localhost:4637. Requires Node.js ≥ 20.19 or ≥ 22.12, macOS.

To only build the cache database without starting the server:

$ npx agentlytics --collect

Supported Editors

14 editors and counting.

Editor ID Msgs Tools Models Tokens
Cursorcursor⚠️⚠️
Windsurfwindsurf
Windsurf Nextwindsurf-next
Antigravityantigravity
Claude Codeclaude-code
VS Codevscode
VS Code Insidersvscode-insiders
Zedzed
OpenCodeopencode
Codexcodex
Gemini CLIgemini-cli
Copilot CLIcopilot-cli
Cursor Agentcursor-agent
Command Codecommandcode

⚠️ Windsurf, Windsurf Next, and Antigravity must be running during scan.

How It Works

All data stays local. No accounts, no cloud, no telemetry.

Editor files/APIs editors/*.js cache.js (SQLite) server.js (REST) React SPA

All data is normalized into a local SQLite cache at ~/.agentlytics/cache.db. The Express server exposes read-only REST endpoints consumed by the React frontend.

Relay:  join clients POST /relay/sync relay.db (SQLite) MCP server AI clients

Relay

Share AI session context across your team.

Relay enables multi-user context sharing. One person starts a relay server, others join and share selected project sessions. An MCP server is exposed so AI clients can query across everyone's coding history.

Start a relay

$ npx agentlytics --relay

Optionally protect with a password:

$ RELAY_PASSWORD=secret npx agentlytics --relay

Join a relay

$ npx agentlytics --join <host:port> --username <name>

If the relay is password-protected:

$ RELAY_PASSWORD=secret npx agentlytics --join <host:port>

Username is auto-detected from git config user.email. You can override it with --username.

MCP Tools

Connect your AI client to the relay's MCP endpoint (http://<host>:4638/mcp) to access these tools:

ToolDescription
list_usersList all connected users and their shared projects
search_sessionsFull-text search across all users' chat messages
get_user_activityGet recent sessions for a specific user
get_session_detailGet full conversation messages for a session

API Reference

Read-only REST API at http://localhost:4637. All endpoints return JSON.

EndpointDescription
GET /api/overviewDashboard KPIs, editors, modes, trends
GET /api/daily-activityDaily counts for heatmap
GET /api/dashboard-statsHourly, weekday, streaks, tokens, velocity
GET /api/chatsPaginated session list
GET /api/chats/:idFull chat with messages
GET /api/projectsProject-level aggregations
GET /api/deep-analyticsTool/model/token breakdowns
GET /api/tool-callsIndividual tool call instances
GET /api/refetchSSE: wipe cache and rescan

All endpoints accept optional editor filter. See API.md for full request/response documentation.

Relay REST API

Endpoints for the relay server at port 4638.

EndpointDescription
GET /relay/healthHealth check and user count
GET /relay/usersList connected users
GET /relay/search?q=<query>Search messages across all users
GET /relay/activity/:usernameUser's recent sessions
GET /relay/session/:chatIdFull session detail
POST /relay/syncReceives data from join clients

Relay is designed for trusted local networks. Set RELAY_PASSWORD env on both server and clients to enable password protection.

Roadmap

What's coming next.