By agenticsec
Track Claude Code session usage—tokens, costs, skills, MCP, subagents—by sending data to a self-hosted dashboard. Check dashboard status to confirm tracking is active and automate custom Python scripts at session end via hooks.
npx claudepluginhub agenticsec/claudecodeusagedashboard --plugin claude-code-usage-dashboard-pluginEfficient skill management system with progressive discovery — 410+ production-ready skills across 33+ domains
Open-source, local-first Claude Code plugin for token reduction, context compression, and cost optimization using hybrid RAG retrieval (BM25 + vector search), reranking, AST-aware chunking, and compact context packets.
Share bugs, ideas, or general feedback.
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.

/commit and other slash commandsInstalling 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@AgenticSec
Create ~/.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/env
Then 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:
claude plugin list includes claude-code-usage-dashboard-plugin~/.claude-code-usage-dashboard/env exists and CLAUDE_CODE_USAGE_DASHBOARD_URL is setclaude auth status shows 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-plugin
Prerequisites: 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 dev
The 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@AgenticSec
Claude 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.
~/.claude/projects/{hash}/{session_id}.jsonlclaude auth statusVerify the Stop hook is registered in .claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/session-uploader.py"
}
]
}
]
}
}
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim