Model Usage
Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Model Usage when an AI agent needs a reusable SKILL.md workflow for this job: Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns.
When not to use it
Skip Model Usage when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/model-usage # Save SKILL.md to ~/.claude/skills/model-usage/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/model-usage/SKILL.md. For a shared project, commit the folder at .claude/skills/model-usage/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Model Usage skill for this task: Use Model Usage when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
68/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 70/100
- Practical detail
- 68/100
- Source evidence
- 63/100
- Source signals
- 72/100
Model compatibility evidence
- claudeinferred
The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
# Model usage
## Overview
Get per-model usage cost from CodexBar's local cost logs. Supports "current model" (most recent daily entry) or "all models" summaries for Codex or Claude.
CodexBar ships CLI builds for macOS and Linux. When `codexbar` is on `PATH`, the skill reads local usage directly; the bundled Python summarizer also accepts exported CodexBar JSON through `--input` anywhere Python is available.
## Quick start
1. Fetch cost JSON via CodexBar CLI or pass a JSON file. 2. Use the bundled script to summarize by model.
```bash python {baseDir}/scripts/model_usage.py --provider codex --mode current python {baseDir}/scripts/model_usage.py --provider codex --mode all python {baseDir}/scripts/model_usage.py --provider claude --mode all --format json --pretty ```
## Current model logic
- Uses the most recent daily row with `modelBreakdowns`. - Picks the model with the highest cost in that row. - Falls back to the last entry in `modelsUsed` when breakdowns are missing. - Override with `--model <name>` when you need a specific model.
## Inputs
- Default: runs `codexbar cost --format json --provider <codex|claude>`. - macOS and Linux: use the bundled Homebrew formula installer above for live local usage reads. Linux users can also use CodexBar's [AUR package](https://aur.archlinux.org/packages/codexbar-cli) or [official release tarballs](https://github.com/steipete/CodexBar/releases). - Other platforms: use `--input` with exported CodexBar JSON. - File or stdin:
```bash codexbar cost --provider codex --format json > /tmp/cost.json python {baseDir}/scripts/model_usage.py --input /tmp/cost.json --mode all cat /tmp/cost.json | python {baseDir}/scripts/model_usage.py --input - --mode current ```
## Output
- Text (default) or JSON (`--format json --pretty`). - Values are cost-only per model; tokens are not split by model in CodexBar output.
## References
- Read `references/codexbar-cli.md` for CLI flags and cost JSON fields.
Intended uses
- Use Model Usage when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.