model-usage
Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.
Security Assessment
About model-usage
The model-usage skill provides cost analysis and summarization of AI model usage from CodexBar's local cost logs. It addresses the need for developers and teams to track and understand their AI API spending across different models, particularly when using Codex or Claude providers. By extracting and summarizing cost data from CodexBar's JSON logs, users can quickly identify which models are consuming the most resources and make informed decisions about model selection and budget allocation.
The skill features flexible cost reporting with two primary modes: 'current' mode shows the most recent model's costs, while 'all' mode provides a comprehensive breakdown across all models used. It supports both live data retrieval through CodexBar CLI integration on macOS and file-based input for cross-platform usage. Output can be formatted as human-readable text or structured JSON, making it suitable for both interactive terminal use and automated reporting pipelines. The bundled Python script handles the heavy lifting of parsing CodexBar's cost data and aggregating per-model expenses.
This skill is designed for developers, DevOps engineers, and finance teams who need to monitor AI API costs in development workflows. It's particularly useful for organizations running CodexBar for cost tracking, teams comparing model performance versus cost tradeoffs, and individuals who want visibility into their daily or cumulative AI spending. The skill works seamlessly with existing CodexBar installations on macOS, while also supporting manual JSON export workflows for Linux and other platforms.
FAQ
What platforms does this skill support?
Live CodexBar CLI integration is documented for macOS only. However, the Python summarizer script is portable and works on any platform with Python if you provide exported CodexBar JSON via the --input flag.
How does 'current model' mode determine which model to show?
Current mode finds the most recent daily log entry with model breakdowns and selects the model with the highest cost. If breakdowns are unavailable, it falls back to the last entry in the modelsUsed list. You can override this automatic selection using the --model flag.
Can I use this skill without installing CodexBar?
Yes, if you already have CodexBar JSON cost logs exported to a file, you can run the script in --input mode with that file. This works on any platform with Python available, independent of CodexBar installation.
What information does the output include?
The output shows per-model cost data. Token counts are not broken down by individual model in CodexBar's output format. You can choose between human-readable text format (default) or structured JSON output using --format json.
Which AI providers are supported?
The skill currently supports Codex and Claude providers as specified through the --provider flag when fetching cost data from CodexBar.
Install model-usage
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
steipete/clawdis