ClaudeCodeUsage is a VSCode extension that tracks Claude Code usage and costs in real-time. It helps developers and operations teams monitor their AI code generation expenses directly in the status bar. The extension integrates with VSCode workflows, providing visibility into usage patterns and cost trends.
git clone https://github.com/jack21/ClaudeCodeUsage.gitClaudeCodeUsage is a VS Code status-bar extension that monitors your Claude Code token consumption and provides cost estimates based on public per-million-token rates. It reads local Claude Code conversation logs to display usage patterns, including breakdowns by token type (input, output, cache-write, cache-read) and model. The extension features a dashboard with charts, sessions, projects, and content analysis tabs that show where tokens are consumed—your prompts, tool results, and assistant output. An optional AI advisor (powered by DeepSeek V4 Pro or your own OpenAI-compatible API) analyzes your usage patterns and suggests concrete prompt rewrites to reduce token waste. Developers and operations teams use it to gain visibility into AI code generation expenses and optimize their Claude Code workflows without relying on external billing tools.
[{"step":"Install the ClaudeCodeUsage extension in VSCode from the Extensions Marketplace. Search for 'ClaudeCodeUsage' and click Install. Restart VSCode to activate the extension.","tip":"Ensure you're logged into your Claude account within VSCode for the extension to track your usage accurately."},{"step":"Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and type 'ClaudeCode: Generate Usage Report'. Select the option to create a new report.","tip":"For specific time periods, use the extension's status bar icon to set custom date ranges before generating reports."},{"step":"Review the generated report in the extension's output panel. Use the interactive visualizations to drill down into specific files, languages, or time periods.","tip":"Enable the 'Cost Alerts' feature in the extension settings to get notified when your daily usage exceeds a set threshold."},{"step":"Implement the optimization recommendations provided in the report. Use the extension's 'Prompt Templates' feature to create reusable templates for common coding tasks.","tip":"Track your progress by generating weekly reports and comparing metrics to identify improvements in your coding efficiency."},{"step":"Share aggregated reports with your team by exporting the data (CSV/JSON) via the extension's export feature. Use this for budget planning or team-wide optimization discussions.","tip":"Set up monthly cost budget alerts in the extension settings to proactively manage your AI code generation expenses."}]
Monitor daily and weekly token usage quotas directly in VS Code status bar
Analyze token consumption breakdown by content type to optimize prompts
Get AI-powered suggestions to reduce unnecessary token spending
Track usage patterns across multiple projects and sessions with sortable dashboards
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/jack21/ClaudeCodeUsageCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Use the ClaudeCodeUsage VSCode extension to analyze my recent [TIME_PERIOD, e.g., 'last week's'] AI-assisted code generation activity. Generate a report that includes: (1) total tokens used, (2) estimated cost breakdown by programming language, (3) top 3 most expensive files I modified, and (4) recommendations to optimize my usage. Focus on [SPECIFIC_GOAL, e.g., 'reducing costs for TypeScript projects' or 'identifying inefficient prompts'].
Here's your AI code generation usage report for the past 7 days (March 10-16, 2024) based on data from the ClaudeCodeUsage extension: **Summary Metrics:** - Total tokens generated: 124,850 (≈124.9K) - Estimated cost: $37.46 (at $0.30 per 1K tokens) - Average session duration: 8.2 minutes - Peak usage day: March 14 (23 sessions, $8.72 spent) **Cost Breakdown by Language:** 1. TypeScript: 45,200 tokens ($13.56) - 36% of total 2. Python: 38,750 tokens ($11.63) - 31% of total 3. JavaScript: 22,100 tokens ($6.63) - 18% of total 4. SQL: 10,800 tokens ($3.24) - 9% of total 5. Other: 8,000 tokens ($2.40) - 6% of total **Top 3 Most Expensive Files Modified:** 1. src/components/dashboard/AnalyticsChart.tsx (7,850 tokens, $2.36) 2. backend/services/paymentProcessor.py (6,200 tokens, $1.86) 3. scripts/dataMigration.js (5,400 tokens, $1.62) **Optimization Recommendations:** 1. **TypeScript Cost Reduction:** Your TypeScript files account for the highest cost. Try breaking complex components into smaller files to reduce context length. Consider using the extension's 'Prompt Optimization' feature for TypeScript-specific queries. 2. **Session Management:** You had 3 sessions lasting over 20 minutes (March 12, 13, 14). These sessions cost $4.20, $5.10, and $6.80 respectively. Try setting a 10-minute timer for complex tasks to maintain focus and reduce costs. 3. **Python Efficiency:** Your Python backend services show room for improvement. The extension detected 4 instances where you asked for similar refactoring - consider creating reusable prompt templates for common Python patterns to reduce redundant queries. **Trend Analysis:** Your usage shows a 15% increase in tokens from the previous week, primarily driven by dashboard development. The extension's 'Language Trend' view suggests this spike correlates with your team's focus on analytics features. Would you like me to suggest specific prompt templates for dashboard component development? *Data source: ClaudeCodeUsage extension v1.2.3 (VSCode). Cost estimates based on current pricing tiers.*
Accounting software with automated invoicing and reporting
AI assistant built for thoughtful, nuanced conversation
Create Beautiful Branded Deliverables. Ship Professionally. Repeat.
IronCalc is a spreadsheet engine and ecosystem
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan