Repository navigation
v1.2.0 - Token Tracking & Analytics
What's New
Token Tracking & Cost Estimation
Track your Claude API usage and costs directly in ClaudeCodeHistory!
Key Features
-
π Token Analytics Dashboard
- Total token usage across all conversations
- Breakdown by type: Input, Output, Cache Writes, Cache Reads
- Real-time cost estimation based on Claude 3.5 Sonnet pricing
- Formatted numbers with thousands separators for easy reading
-
π° Cost Estimation
- Automatic cost calculation per conversation
- Total cost aggregation in Statistics screen
- Based on current Claude API pricing:
- Input: $3/M tokens
- Output: $15/M tokens
- Cache Writes: $3.75/M tokens
- Cache Reads: $0.30/M tokens
-
π Enhanced Search Results
- Token count and cost displayed on each conversation card
- Model name badges (e.g., "Sonnet 4.5", "Opus", "Haiku")
- Quick visibility into conversation resource usage
-
π Metadata Extraction
- Automatically parses token usage from conversation files
- Extracts model information
- Tracks all token types including cache metrics
Improvements
-
Better Embedding Error Handling
- Skips empty or very short conversations (< 10 chars)
- Improved error messages with content previews
- Early validation to prevent unnecessary API calls
- Better debugging with detailed logging
-
MIT License
- Project is now officially licensed under MIT
- Open source and free to use, modify, and distribute
Bug Fixes
- Fixed OllamaClient crash when embeddings list is empty
- Added content validation before embedding generation
- Improved error messages for troubleshooting Ollama issues
Technical Details
Token Tracking Implementation:
- New
TokenUsagedata class with automatic cost calculation - Enhanced
ConversationMetadatato include usage information - Updated parser to extract token data from conversation JSON
- Extended
ConversationStatisticswith token aggregation
UI Components:
- New "Token Usage & Cost Estimation" card in Statistics screen
- Enhanced
SearchResultCardwith token and model chips - Formatted display of large numbers
- Conditional rendering based on data availability
Pricing Model:
Based on Claude 3.5 Sonnet (January 2025):
- Input: $3 per million tokens
- Output: $15 per million tokens
- Cache Writes: $3.75 per million tokens
- Cache Reads: $0.30 per million tokens
Installation
Download the appropriate installer for your platform from the assets below.
Upgrading from v1.1.0
Simply install the new version. Your existing database and conversations will work seamlessly. Re-index conversations to populate token data for historical conversations.
Full Changelog: v1.1.0...v1.2.0