Go Claude Costs — Development skill for Claude Code
Analyze Claude Code usage costs and token statistics from local metadata files.
How to install Go Claude Costs
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open photostructure/go-claude-costs and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Go Claude Costs does
Analyze Claude Code usage costs and token statistics from local metadata files.
Alternatives in Development
- Claude Usage — A local dashboard for tracking your Claude Code token usage, costs, and session history 864 ★
- Memory Statistics — Show statistics about Claude's persistent memory file including total memories, storage size, and recent activ 332 ★
- Claude Code Otel — A comprehensive observability solution for monitoring Claude Code usage, performance, and costs 306 ★
README
go-claude-costs
A Go implementation of [claude-costs](https://github.com/photostructure/claude-costs) - analyze your Claude Code usage costs and statistics by parsing local metadata files.
Features
- 💰 Cost Analysis: Calculate actual API costs with cache savings
- 📊 Token Usage: Track input, output, and cached tokens
- 📁 Project Breakdown: See costs grouped by project
- ⏰ Activity Patterns: Visualize usage by hour and day
- 🤖 Model Usage: Distribution of different Claude models
- ⏱️ Response Times: Analyze response time statistics
- 🔧 Tool Usage: Track tool acceptance/rejection rates
Installation
From Source
go install github.com/photostructure/go-claude-costs/cmd/claude-costs@latest
Build Locally
git clone https://github.com/photostructure/go-claude-costs
cd go-claude-costs
go build -o claude-costs ./cmd/claude-costs
Usage
# Analyze last 30 days (default)
claude-costs
# Analyze last 7 days
claude-costs -d 7
# Show all projects (not just top 10)
claude-costs -v
# Show detailed cache statistics
claude-costs --cache
# Use custom Claude directory
claude-costs -c /path/to/.claude
Command Line Options
-d, --days: Number of days to analyze (default: 30)-v, --verbose: Show all projects instead of top 10--cache: Show detailed cache statistics-c, --claude-dir: Path to Claude directory (default: ~/.claude)-h, --help: Show help message
Output Example
Analyzing: /home/user/.claude
💰 $1234.56 API value (last 30 days, 25 with activity)
📊 142 sessions • $8.69/session • $49.38/day
Note: This shows API value, not your actual subscription cost
🔤 345.2M tokens total
📁 Project Costs
┌─────────────────────────────┬─────────┬──────────┬────────┬──────┬──────────────┐
│ PROJECT │ COST │ SESSIONS │ TOKENS │ DAYS │ AVG RESPONSE │
├─────────────────────────────┼─────────┼──────────┼────────┼──────┼──────────────┤
│ my-web-a
Related Skills
Claude Usage
Local dashboard for visualizing Claude Code token usage and estimated API costs
Tokens Gone
Local dashboard for Claude Code token usage and costs. Reads ~/.claude/projects//.jsonl, aggregates spend, sli
Claude Skills Dashboard
A local dashboard for your Claude Code skills and plugins: enable/disable, install, delete, token costs and us
Cc Statistics
270+ Three-in-one Claude Code stats: CLI + Web + native macOS SwiftUI panel. Token costs, code changes by lang
Pseudo Vision Skill
Local OCR, color-statistics, pixel-scan, and metadata bridge as a cross-framework skill for text-only agent mo
Tokmira
Free, local-first Claude Code & Codex usage monitor. Track quotas, analyze token usage, and find waste.
Related Agents
API Cost Scanner
Scans codebase for AI/API cost optimization opportunities including model usage, token estimates, caching stra
Stats Analyzer
Analyzes ~/.claude/stats-cache.json and history.jsonl to produce a concise usage report with model token break
Nay
Agentistics intelligence agent. Use Nay when you need to query Claude Code usage metrics, analyze costs and pa