Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Claude Usage AnalyticsNew to Visual Studio Code? Get it now.
Claude Usage Analytics

Claude Usage Analytics

Analytic Endeavors

|
2 installs
| (0) | Free
Real-time Claude Code usage stats, costs, and analytics in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Claude Usage Analytics

Version VS Code License Platform TypeScript


What is Claude Usage Analytics?

Claude Usage Analytics is a VS Code extension that provides real-time insights into your Claude Code usage. Built by Reid Havens of Analytic Endeavors, this tool transforms raw usage data into actionable intelligence—helping you understand costs, monitor usage patterns, and discover insights in your AI-assisted development workflow.

Track your Claude Code usage with real-time analytics in VS Code. Monitor costs, tokens, and subscription tier. Explore personality insights, achievement badges, and coding patterns. Features a 4-tab dashboard and 7 status bar widgets showing lifetime costs, daily spending, cache efficiency, and usage trends.


Screenshots

Status Bar with Tooltip

View Dashboard Screenshots

Overview

Overview Report

Cost Analysis

Cost Report

Messages

Messages Report

Personality

Personality Report


Key Features

Status Bar Widgets

Seven live statistics widgets always visible at a glance:

Widget Icon Displays Click Action
Lifetime Cost $(graph) Total all-time spending Opens Overview tab
Today's Cost $(calendar) Real-time current day usage Opens Cost tab
Messages $(comment-discussion) Total message count Opens Messages tab
Tokens $(symbol-number) Token consumption Opens Messages tab
Personality Emoji Politeness score % Opens Personality tab
Activity Chart Code blocks generated Opens Personality tab
Subscription $(pulse) Subscription tier (Max 20x, Pro, etc.) Opens Overview tab

Interactive Dashboard

A comprehensive 4-tab analytics panel with deep insights:

Tab Content
Overview Hero stats, quick metrics, daily activity visualization, model distribution breakdown
Cost Detailed cost analysis, 7-day trends, monthly projections, highest spending days, cache savings calculations
Messages Token breakdown (input/output/cache), peak usage hours, activity patterns, session statistics
Personality Achievement badges, personality trait scores, expression analysis, mood & sentiment tracking

Feature Details

Cost Analytics

Understand exactly where your tokens go

  • Real-time cost tracking with model-specific pricing (Opus vs Sonnet rates)
  • Real-time today's cost calculated directly from conversation files
  • Daily/weekly/monthly breakdowns with trend analysis
  • Cost projections based on your usage patterns
  • Cache savings calculator showing money saved through prompt caching
  • Comparison metrics vs yesterday and vs average day
  • Highest spending day identification

Personality Insights

Discover your unique interaction style

  • Politeness Score — Measures "please" and "thanks" frequency
  • Frustration Index — Tracks caps lock usage, expletives, and facepalms
  • Curiosity Score — Questions asked per message ratio
  • Achievement Badges — Unlock milestones as you hit usage goals:
    • Token Titan (1M+ tokens)
    • Conversation Master (1000+ messages)
    • Streak Champion (7+ day streak)
    • Politeness Pro (80%+ politeness)
    • ...and more!

Subscription Display

Know your current plan at a glance

  • Subscription tier display — Shows Max 20x, Max, Pro, or Free
  • Plan information from Claude Code credentials
  • Green status indicator when tier is detected

Activity Tracking

Analyze your coding patterns

  • Code blocks generated with line counts
  • Top programming languages used
  • Request type distribution (debugging, features, explanations, refactoring)
  • Peak hours analysis — when you're most active
  • Night owl vs early bird scoring
  • Session statistics and longest session tracking

Privacy & Security

This extension prioritizes your privacy:

Aspect Implementation
Data Location All data stays on your machine
Network Calls None — fully offline operation
Telemetry None — zero tracking or analytics
Open Source Full source code available for audit

Data Sources:

  • ~/.claude/stats-cache.json — Token usage and model statistics
  • ~/.claude/projects/*/ — Conversation history for personality analysis and real-time today's cost
  • ~/.claude/.credentials.json — Subscription tier information (read-only)

Installation

Option 1: From VSIX Package (Recommended)

Download the latest .vsix from Releases, then:

code --install-extension claude-usage-analytics-1.0.2.vsix

Option 2: From Source

# Clone the repository
git clone https://github.com/analyticendeavors/claude-usage-analytics.git
cd claude-usage-analytics

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Package the extension
npx vsce package

# Install the generated .vsix
code --install-extension claude-usage-analytics-1.0.2.vsix

Requirements

Requirement Details
VS Code Version 1.95.0 or higher
Claude Code CLI Must be installed and authenticated
Operating System Windows 10/11, macOS, or Linux
Node.js v18+ (for building from source)

Pre-requisites

  1. Install Claude Code CLI: Follow Anthropic's installation guide
  2. Authenticate: Run claude auth login to authenticate
  3. Verify: Run claude --version to confirm installation

Usage Guide

Status Bar Navigation

The extension adds widgets to your VS Code status bar:

  • Left side: Cost, messages, tokens, personality, activity stats
  • Right side: Subscription tier indicator

Click any widget to open the dashboard focused on the relevant tab. Each tooltip shows "Click to open [Tab Name]" for easy navigation.

Keyboard Shortcuts

Shortcut Action
Ctrl+Alt+C Show Analytics Panel
Ctrl+Alt+R Refresh All Data

On macOS, use Cmd instead of Ctrl

Command Palette

Access via Ctrl+Shift+P (or Cmd+Shift+P on Mac):

Command Description
Refresh Claude Usage Force refresh all statistics
Show Claude Analytics Panel Open the dashboard
Show Claude Analytics - Overview Jump to Overview tab
Show Claude Analytics - Cost Jump to Cost tab
Show Claude Analytics - Messages Jump to Messages tab
Show Claude Analytics - Personality Jump to Personality tab

Architecture Overview

claude-usage-analytics/
├── src/
│   ├── extension.ts        # Extension entry point & command registration
│   ├── statusBar.ts        # 7 status bar widgets with tooltips
│   ├── dashboardView.ts    # 4-tab webview dashboard
│   ├── dataProvider.ts     # Stats parsing, cost calculations & real-time today
│   └── limitsProvider.ts   # Subscription tier from credentials
├── out/                    # Compiled JavaScript
├── media/
│   ├── icon.png           # Extension icon (128x128)
│   └── claude-icon.svg    # Activity bar icon
└── package.json           # Extension manifest & configuration

Key Components

Component Responsibility
StatusBarManager Creates and updates 7 status bar items with rich tooltips
DashboardViewProvider Renders the 4-tab webview with real-time data
getUsageData() Parses stats-cache.json and calculates all metrics
getTodayRealTimeUsage() Reads JSONL files for accurate today's cost
getSubscriptionInfo() Reads subscription tier from credentials file

Frequently Asked Questions

Why don't I see any data?

Ensure Claude Code CLI is installed and you've used it at least once. The extension reads from ~/.claude/stats-cache.json which is created after your first Claude Code session.

How accurate are the cost calculations?

Costs use model-specific pricing:

  • Claude Opus 4.5: $15/1M input, $75/1M output, $18.75/1M cache write, $1.50/1M cache read
  • Claude Sonnet: $3/1M input, $15/1M output

Today's cost is calculated in real-time from conversation files for maximum accuracy.

Why does the subscription widget show "N/A"?

Claude Code credentials may not be found. Ensure you're authenticated with claude auth login.

How often does data refresh?

  • Automatic: Every 2 minutes
  • Manual: Click refresh button or press Ctrl+Alt+R

Is my data sent anywhere?

No. All analysis happens locally. There are no network calls — the extension operates fully offline.

Can I use this without Claude Code CLI?

No. This extension specifically reads Claude Code's local statistics files. It's designed as a companion tool for Claude Code users.


Troubleshooting

Status bar shows "Claude" but no statistics

  1. Verify Claude Code is installed: claude --version
  2. Check authentication: claude auth status
  3. Confirm stats file exists: ls ~/.claude/stats-cache.json
  4. Try using Claude Code once to generate initial data

Subscription shows "N/A"

  1. Re-authenticate: claude auth login
  2. Restart VS Code
  3. Check credentials file exists: ls ~/.claude/.credentials.json

Dashboard not loading

  1. Try the refresh command: Ctrl+Alt+R
  2. Reload VS Code window: Ctrl+Shift+P > "Reload Window"
  3. Check for extension errors in Developer Tools: Ctrl+Shift+I

Personality stats seem wrong

Personality analysis requires conversation history in ~/.claude/projects/. If you recently cleared your history or are using a new machine, stats will rebuild over time.


Development

Setup

git clone https://github.com/analyticendeavors/claude-usage-analytics.git
cd claude-usage-analytics
npm install

Build Commands

npm run compile    # Build once
npm run watch      # Watch mode for development
npm run lint       # Run ESLint
npx vsce package   # Create .vsix package

Testing Locally

  1. Open the project in VS Code
  2. Press F5 to launch Extension Development Host
  3. The extension will load in the new window

Changelog

v1.0.2 (2025-12-21)

  • Real-time today's cost: Now reads directly from conversation JSONL files for accurate current-day statistics
  • Subscription tier display: Shows Max 20x, Max, Pro, or Free tier instead of rate limit percentages
  • Fully offline: Removed all network API calls — extension operates completely locally
  • Improved tooltips: All status bar widgets now show "Click to open [Tab Name]" for clarity
  • Removed Limits section: Dashboard no longer shows the obsolete rate limit progress bars
  • Fixed credentials reading: Now correctly reads from ~/.claude/.credentials.json

v1.0.0 (2025-12-20)

  • Initial release
  • 7 status bar widgets with rich tooltips
  • 4-tab interactive dashboard
  • Cost analytics with model-specific pricing
  • Personality insights and achievements
  • Activity tracking and coding patterns

License

MIT License — see LICENSE for details.

Copyright (c) 2024-2025 Analytic Endeavors


Acknowledgments

  • Built with Claude Code
  • Inspired by the need to understand AI-assisted development patterns

Built by Analytic Endeavors

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft