Tokscale is a CLI tool for tracking token usage and costs across AI coding assistants like OpenCode, Claude Code, and Gemini CLI. It helps developers and operations teams monitor usage, optimize costs, and integrate with IDEs like Cursor and AmpCode.
git clone https://github.com/junhoyeo/tokscale.githttps://github.com/junhoyeo/tokscale
["Install tokscale: `pip install tokscale` or use the pre-built binary for your OS.","Configure your AI tools: Add API keys for OpenCode, Claude Code, and Gemini CLI in `~/.tokscalerc`.","Run analysis: Execute `tokscale --project [PROJECT_NAME] --timeframe [TIME_PERIOD]` to generate a report.","Export data: Use `tokscale --export-csv` to share results with your team or integrate with tools like Grafana.","Optimize: Apply the tool’s suggestions (e.g., truncate comments, enable caching) and re-run the analysis to validate savings."]
Monitor token usage across multiple AI platforms to optimize costs.
Analyze daily token consumption trends to identify peak usage times.
Visualize contributions and performance over time with interactive graphs.
Submit usage data to leaderboards for competitive analysis and community engagement.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/junhoyeo/tokscaleCopy 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 tokscale to analyze the token usage and costs for [PROJECT_NAME] over the past [TIME_PERIOD]. Compare the usage across [TOOLS_OR_MODELS] and identify the top 3 most expensive operations. Suggest optimizations to reduce costs by at least [PERCENTAGE]%.
Here’s the token usage and cost analysis for the 'E-Commerce API' project over the past 30 days using tokscale: **Total Token Usage:** 1,245,678 tokens - OpenCode: 678,901 tokens ($135.78) - Claude Code: 456,789 tokens ($91.36) - Gemini CLI: 110,988 tokens ($22.20) **Top 3 Most Expensive Operations:** 1. **Database Schema Migration** (Claude Code): 234,567 tokens ($46.91) – Generated 50+ SQL files with verbose comments. 2. **API Documentation Update** (OpenCode): 189,012 tokens ($37.80) – Used multi-turn prompts to refine Swagger docs. 3. **Test Suite Refactor** (Gemini CLI): 98,765 tokens ($19.75) – Overly detailed test case explanations. **Cost Optimization Recommendations:** - **Truncate verbose comments** in generated SQL files to reduce tokens by ~30%. - **Use summarization tools** (e.g., `summarize` CLI) for API docs to cut input/output tokens by 40%. - **Enable caching** in test suites to avoid re-generating identical test cases (saves ~25% tokens). **Projected Savings:** ~$75/month with these changes. Run `tokscale --export-csv` to generate a detailed breakdown for your team.
AI assistant built for thoughtful, nuanced conversation
Google's multimodal AI model and assistant
AI-first code editor
Automate invoicing and financial reporting for streamlined business management.
Metagenomic analysis for microbiome research
Enterprise workflow automation and service management platform
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan