A self-hosted dashboard to visualize and share Claude Code usage across your team.
A Stop hook automatically parses transcripts at session end, collecting token consumption, skill / MCP / sub-agent usage, and estimated costs into interactive charts.
- Data Collection — Zero-config data collection via Stop hook
- Token & Cost Tracking — Input / output / cache read / cache creation tokens with per-model cost estimation
- Skill Analysis — Invocation frequency of
/commitand other slash commands - MCP Server Analysis — Call counts by MCP server name and method
- Sub-agent Analysis — Agent tool usage (Explore, Plan, etc.)
- Team Overview — Per-user cost ranking, daily trends, model distribution
Installing the plugin enables automatic data submission to the dashboard when a Claude Code session ends.
# Register the marketplace (only registered locally, not published externally)
claude plugin marketplace add https://github.com/AgenticSec/ClaudeCodeUsageDashboard.git
# Install the plugin (applies to all projects)
claude plugin install claude-code-usage-dashboard-plugin@AgenticSecCreate ~/.claude-code-usage-dashboard/env with your dashboard URL. This config is shared across all projects.
mkdir -p ~/.claude-code-usage-dashboard
cp .env.example ~/.claude-code-usage-dashboard/envThen edit ~/.claude-code-usage-dashboard/env:
# For local development (cd dashboard && npm run dev)
CLAUDE_CODE_USAGE_DASHBOARD_URL=http://localhost:5173
# For a deployed dashboard
CLAUDE_CODE_USAGE_DASHBOARD_URL=https://dashboard.your-account.workers.dev
# Optional: restrict to specific directories (fnmatch patterns, comma-separated)
# If unset, all projects are allowed.
CLAUDE_CODE_USAGE_DASHBOARD_ALLOWED_DIRS=/Users/me/work/*,/Users/me/oss/*You can verify the setup completed successfully:
- Plugin:
claude plugin listincludesclaude-code-usage-dashboard-plugin - Environment:
~/.claude-code-usage-dashboard/envexists andCLAUDE_CODE_USAGE_DASHBOARD_URLis set - Auth:
claude auth statusshows your email (used for user identification)
In-session check: Run /claude-code-usage-dashboard:status in any Claude Code session to see whether the dashboard is enabled for the current process. This reports plugin status, config, auth, and whether the project directory is allowed.
claude plugin uninstall claude-code-usage-dashboard-pluginPrerequisites: Node.js 18+, Wrangler CLI (npm install -g wrangler)
cd dashboard
npm install
# Apply migrations to local D1
npx wrangler d1 migrations apply claude-code-usage-dashboard --local
# Start the dev server
npm run devThe application will be available at http://localhost:5173.
To test with a local clone of this repository instead of the remote:
# Register from local path (run from the repository root)
claude plugin marketplace add ./
# Install the plugin
claude plugin install claude-code-usage-dashboard-plugin@AgenticSecClaude Code session ends
│
▼
Stop hook (session-uploader.py)
│ Parses ~/.claude/projects/{hash}/{session_id}.jsonl
│ Extracts tokens, skills, MCP calls, sub-agent events
│
▼
POST /api/v1/usage/ingest
│
▼
Web application (React Router v7 SSR)
│
▼
Database (SQLite)
│
▼
Dashboard UI (Recharts)
The Stop hook (hooks/session-uploader.py) runs automatically when a Claude Code session ends.
| Data | Description |
|---|---|
| Session info | session_id, project, branch, model, timestamps, conversation turns |
| Tokens | input, output, cache_read, cache_creation |
| Skill events | /commit etc. (extracted from <command-message> tags) |
| MCP events | Server name, method name (e.g. notion/notion-fetch) |
| Sub-agent events | Agent type (Explore, Plan, etc.) |
Estimated costs are not stored in the DB. They are calculated dynamically at display time using token counts, models, and a pricing table.
- Stop hook fires at session end
- Parses
~/.claude/projects/{hash}/{session_id}.jsonl - Extracts skill usage, MCP tool usage, sub-agent usage, and token counts
- Retrieves email via
claude auth status - POSTs to the API with Service Token headers (runs in background)
Verify the Stop hook is registered in .claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-uploader.py"
}
]
}
]
}
}Verify Claude Code is authenticated (email is used for user identification):
claude auth status