Token Dashboard para Agents
wbwztmdl/TokenDashboard
Monitore tokens e custos de agents em tempo real com zero dependências
Ver no GitHubDashboard leve e sem dependências para monitorar uso de tokens e custos em tempo real em frameworks de agents. Oferece visibilidade granular do consumo de tokens e despesas financeiras, com suporte nativo para Claude Code e Codex. Arquitetura extensível permite adicionar novos frameworks e idiomas facilmente.
Instalação
npx convez-ai wbwztmdl/TokenDashboard1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Rastrear gastos com chamadas de API em projetos com agents
- Monitorar uso de cache em conversas Claude Code
- Analisar métricas de tokens em diferentes modelos e frameworks
- Debugar e otimizar consumo de tokens em agentes customizados
Veredito

Ferramenta prática e bem arquitetada para DevOps de agentes. A ausência de dependências externas e design extensível são grandes trunfos; porém, a exigência de logs locais limita seu escopo a frameworks específicos.
README
A tradução para o português deste README ainda está na fila.
Agent Token Cost Dashboard
This is a lightweight, zero-dependency, and highly extensible token usage and cost monitoring dashboard for Agent frameworks. Featuring a minimalist architecture, it provides real-time visibility into fine-grained token consumption and financial expenses across various agent frameworks. Native support for Claude Code and Codex is built-in. The underlying principle is to read the persistent session files stored locally by the Agent frameworks and extract token consumption data. As such, it only supports frameworks that persist session logs locally, and model providers that include token details in their API response metadata. While the vast majority of frameworks and providers meet these requirements, please be aware that a few may not be supported.
Display
Key Advantages
- Lightweight & Zero-dependency:
- The backend runs purely on Python's built-in
http.serverandsocketserver.ThreadingTCPServer. Nopipinstallations are required. - The frontend is built with pure HTML5, Vanilla JS, and CSS3, requiring no build tools or compilation steps.
- The backend runs purely on Python's built-in
- Highly Extensible:
- Agent Framework Extension: Pluggable design. Simply drop a new Python parser file under the
parsers/directory, and the backend automatically detects and registers the new framework. You can easily instruct an AI to generate this parser by referencing the logic of existing scripts. - Internationalization (i18n): Easily add new languages by dropping a
<LanguageName>.jsonunderpublic/lang/. The "Language" dropdown at the top-right will dynamically populate and load it. - Easily Modify Rates per Million Tokens: Update token prices via the config file or web interface based on your needs, with added support for multipliers.
- Agent Framework Extension: Pluggable design. Simply drop a new Python parser file under the
- Safe & Precise:
- Anti-noise filtering mechanisms verify message roles (e.g. counting only
assistantroles in Claude Code) and calculate increment deltas to prevent double-counting or false parsing of user inputs.
- Anti-noise filtering mechanisms verify message roles (e.g. counting only
- Real-time Updates:
- The service parses the latest conversation in real time during runtime to fetch current token usage. However, a manual page refresh is required (intentional design to reduce unnecessary overhead).
Metrics & Display Categories
The dashboard tracks, displays, and calculates the following key metrics across multiple tabs:
Core Metrics
- Input Tokens: Tokens sent to the model (prompt).
- Output Tokens: Tokens generated by the model (completion).
- Cache Read: Input tokens matched and retrieved directly from cache.
- Cache Write/Create: Tokens consumed during creation or updates of cached context.
- Cache Hit Rate: Calculated as $\frac{\text{Cache Read}}{\text{Input} + \text{Cache Read}} \times 100%$, indicating caching efficiency.
- Estimated Cost / Total Cost: Derived from custom prices set per 1M tokens (input, output, cache read, cache write) and model-specific multipliers.
Display Categories
- Global Stats: Summarizes token type ratios, model distribution percentages, and estimated costs across all sessions.
- Framework Stats: Compares different agent frameworks on sessions, token metrics, cache hit rates, and total costs.
- Project Stats: Aggregates usage by CWD (working directory), supporting glob pattern path exclusions in
config.json. - Session Stats: Lists individual sessions in reverse chronological order with pagination. Users can hover over token counts and cost values to see exact breakdowns and multipliers.
Running & Configuration
Quick Start
Windows (One-Click)
Double-click run.bat in the root directory to start the server. The command window remains open for logging and debugging.
Linux / macOS / Manual
python server.py
Open your browser and navigate to: http://localhost:8000
Configuration (config.json)
The configuration file is automatically created or updated upon saving settings from the sidebar.
{
"exclude_paths": [
"C:\\Users\\xxx\\Documents\\Codex\\*",
"E:\\Develop_Program\\xxx"
],
"lang": "en-US",
"models": {
"deepseek-v4-flash": {
"input": 0.14,
"output": 0.28,
"cacheRead": 0.06,
"cacheCreate": 0.14,
"multiplier": 1.0
}
}
}
- exclude_paths: Paths or glob patterns (e.g.,
*) to exclude directories from the Project Stats view.(Used to exclude temporary chats, which are not projects) - lang: Saved language preference (
zh-CN,en-US, etc.). - models: Set pricing per 1M tokens (USD) and a custom multiplier for each discovered model.
Developer Guide
1. Add a New Agent Parser
- Create a Python script under
parsers/, e.g.,parsers/my_agent.py. - Implement a subclass of
BaseParser(defined inparsers/base.py) and override:
from pathlib import Path
from .base import BaseParser
class MyAgentParser(BaseParser):
def get_framework_name(self) -> str:
return "My New Agent"
def parse_sessions(self, config_manager) -> list[dict]:
# Scan log directory, parse files, calculate cost using config_manager, and return a list of standard session dicts.
pass
Refer to parsers/claude.py or parsers/codex.py for concrete parsing and delta handling examples.
2. Add a New UI Language
- Add a translation JSON file under
public/lang/named<lang-code>.json(e.g.,public/lang/fr.json). - Copy keys from
public/lang/en-US.jsonand translate values. - Save the file. The option will automatically appear in the top-right "Language" menu next time you refresh.