model-usage
steipete/clawdis
Summarize CodexBar local cost logs by model for Codex or Claude usage tracking.
What is model-usage?
Analyzes CodexBar's local cost logs to break down API expenses by model. Use this to understand which models are consuming your budget, whether you want a snapshot of current usage or a full historical breakdown.
- Summarize per-model costs from CodexBar local logs
- Support both Codex and Claude provider cost tracking
- Display current model (most recent daily entry) or all-time summaries
- Output as human-readable text or JSON format
- Override model selection with explicit --model flag
- Fall back to modelsUsed list when detailed breakdowns are unavailable
How to install model-usage
npx skills add https://github.com/steipete/clawdis --skill model-usage- CodexBar installed (macOS: via brew cask steipete/tap/codexbar, or pre-exported JSON on other platforms)
- Python available for running the bundled summarizer script
How to use model-usage
- 1.Run the skill to fetch cost data from CodexBar or provide a JSON file with --input
- 2.Specify provider with --provider codex or --provider claude
- 3.Choose --mode current for the most recent day or --mode all for full history
- 4.Optionally add --format json --pretty to output structured JSON instead of text
- 5.Use --model <name> to override automatic model selection if needed
Use cases
- Track which Claude or Codex model variant is driving your API costs
- Generate a cost report for the current billing period by model
- Export historical model usage as JSON for further analysis
- Compare spending across Codex vs Claude providers over time
- Identify the highest-cost model in your most recent usage day
- Developers monitoring API spending
- Teams tracking Claude/Codex usage costs
- Anyone auditing CodexBar local cost logs
model-usage FAQ
The bundled Python summarizer is portable and works anywhere Python is available. Live CodexBar CLI invocation is documented for macOS only; on other platforms, export CodexBar JSON and use --input mode.
The script falls back to the last entry in modelsUsed when modelBreakdowns are missing, or you can override with --model <name>.
No; CodexBar output does not split tokens by model, only costs.
Export CodexBar JSON (e.g., codexbar cost --format json > /tmp/cost.json) and pass it with --input /tmp/cost.json or pipe via stdin with --input -.
Full instructions (SKILL.md)
Source of truth, from steipete/clawdis.
name: model-usage description: "Summarize CodexBar local cost logs by model for Codex or Claude, including current or full breakdowns." metadata: { "openclaw": { "emoji": "📊", "os": ["darwin"], "requires": { "bins": ["codexbar"] }, "install": [ { "id": "brew-cask", "kind": "brew", "formula": "steipete/tap/codexbar", "bins": ["codexbar"], "label": "Install CodexBar (brew cask)", }, ], }, }
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.
Live CodexBar CLI invocation is currently documented for macOS only. The bundled Python summarizer is portable: if you already have exported CodexBar JSON, --input mode works anywhere Python is available.
Quick start
- Fetch cost JSON via CodexBar CLI or pass a JSON file.
- Use the bundled script to summarize by model.
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
modelsUsedwhen breakdowns are missing. - Override with
--model <name>when you need a specific model.
Inputs
- Default: runs
codexbar cost --format json --provider <codex|claude>. - macOS: use the bundled CodexBar CLI install path above for live local usage reads.
- Linux/other platforms: use
--inputwith exported CodexBar JSON until this skill documents a supported local CodexBar install path for that platform. - File or stdin:
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.mdfor CLI flags and cost JSON fields.
Related skills
More from steipete/clawdis and the wider catalog.

nano-pdf
Edit PDFs with natural-language instructions via CLI.

notion
Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

obsidian
Work with Obsidian vaults via official CLI: read, search, create, edit notes, tasks, links, and properties.

openai-whisper
Local speech-to-text transcription using OpenAI's Whisper CLI—no API key required.

openai-whisper-api
Transcribe audio files using OpenAI's Whisper API and newer gpt-4o models via curl.

openhue
Control Philips Hue lights and scenes via OpenHue CLI.