PluginBench
Skill
Review
Audit score 70

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
Prerequisites
  • CodexBar installed (macOS: via brew cask steipete/tap/codexbar, or pre-exported JSON on other platforms)
  • Python available for running the bundled summarizer script
Claude Code
Cursor
Windsurf
Cline

How to use model-usage

  1. 1.Run the skill to fetch cost data from CodexBar or provide a JSON file with --input
  2. 2.Specify provider with --provider codex or --provider claude
  3. 3.Choose --mode current for the most recent day or --mode all for full history
  4. 4.Optionally add --format json --pretty to output structured JSON instead of text
  5. 5.Use --model <name> to override automatic model selection if needed

Use cases

Good for
  • 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
Who it's for
  • Developers monitoring API spending
  • Teams tracking Claude/Codex usage costs
  • Anyone auditing CodexBar local cost logs

model-usage FAQ

Does this work on Linux or Windows?

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.

What if CodexBar doesn't have detailed model breakdowns?

The script falls back to the last entry in modelsUsed when modelBreakdowns are missing, or you can override with --model <name>.

Can I get token counts by model?

No; CodexBar output does not split tokens by model, only costs.

How do I use this with exported JSON?

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

  1. Fetch cost JSON via CodexBar CLI or pass a JSON file.
  2. 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 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: use the bundled CodexBar CLI install path above for live local usage reads.
  • Linux/other platforms: use --input with 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.md for CLI flags and cost JSON fields.