Quick Summary: 📝
This Python repository provides a local dashboard to visualize and track your Claude Code token usage, session history, and estimated costs. It works by parsing local log files generated by Claude Code, offering insights beyond what the official UI provides, and is compatible with API, Pro, and Max plans.
Key Takeaways: 💡
✅ Gain full, granular visibility into your Claude Code usage (tokens, models, estimated costs) across all plans (API, Pro, Max).
✅ Visualize your AI coding assistant's activity with an intuitive, local web dashboard featuring dynamic charts.
✅ Enjoy effortless setup and zero dependencies, as the project uses only Python's standard library.
✅ Optimize your AI workflow and manage costs by understanding detailed consumption patterns.
✅ Ensure privacy and security, as all usage data is processed and stored locally on your machine.
Project Statistics: 📊
- ⭐ Stars: 1795
- 🍴 Forks: 337
- ❗ Open Issues: 2
Tech Stack: 💻
- ✅ Python
Ever felt like you're flying blind with your AI coding assistant usage? While Claude Code is an incredible tool, whether you're on the API, Pro, or Max plan, getting a clear picture of your token consumption, which models you're actually using, and how much it's all costing can be surprisingly opaque. You might get a basic progress bar with some subscriptions, but what if you need the full, granular detail to truly understand and optimize your workflow? This lack of comprehensive visibility is a common pain point for many developers integrating AI into their daily coding tasks.
That's where a fantastic open-source project, the 'Claude Code Usage Dashboard,' steps in to save the day. This brilliant tool provides the complete transparency you've been craving. Its core purpose is simple yet powerful: it reads the detailed usage logs that Claude Code already writes locally on your machine and transforms that raw data into an intuitive, interactive dashboard. This means you can finally see exactly how you're utilizing Claude, regardless of your subscription type, and gain insights that the official UI simply doesn't offer.
So, how does this magic happen? It's surprisingly straightforward and elegantly designed. Whenever you use Claude Code – be it through the command-line interface, the VS Code extension, or any dispatched Code sessions – Claude generates local JSONL files for each session. These files contain a wealth of information, including crucial details like your input and output token counts, cache usage, and the specific Claude model employed for each interaction. The project's scanner.py script efficiently parses these JSONL files and stores all the relevant data into a local SQLite database, typically located at ~/.claude/usage.db.
Once the data is in the database, the dashboard.py component springs to life. It serves a lightweight, single-page web dashboard directly from your machine, accessible via http://localhost:8080. This dashboard leverages Chart.js (loaded from a CDN) to create visually appealing and easy-to-understand charts. You'll see breakdowns of your usage by model, daily summaries, weekly trends, and even all-time statistics. The dashboard also estimates costs, giving you a tangible sense of your consumption. It even auto-refreshes every 30 seconds and allows for model filtering, making it a dynamic and powerful analytical tool.
The benefits for developers are immense. First and foremost, you gain unparalleled visibility into your AI coding assistant usage. No more guesswork about token counts or model choices; you have concrete data at your fingertips. This is particularly valuable for those using the Claude API, where cost management is paramount. By understanding your token consumption, you can identify patterns, optimize your prompts for efficiency, and ultimately make more informed decisions about your AI-assisted development workflow. It helps you keep your AI budget in check and ensures you're getting the most out of your interactions.
Another huge advantage is the project's incredible ease of setup. Forget pip install headaches, virtual environments, or complex build steps. This tool proudly uses only Python's standard library, meaning anyone who already has Python installed (which most developers do) can get it up and running in minutes. A simple git clone and python cli.py dashboard command is often all it takes, or even a Homebrew install for macOS/Linux users. This low barrier to entry means you can start gaining insights almost immediately. Plus, because all the processing happens locally, your usage data remains private and secure on your machine.
Learn More: 🔗
🌟 Stay Connected with GitHub Open Source!
📱 Join us on Telegram
Get daily updates on the best open-source projects
GitHub Open Source👥 Follow us on Facebook
Connect with our community and never miss a discovery
GitHub Open Source
Top comments (0)