Model Usage
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 98 · 27.9k · 1.3k current installs · 1.3k all-time installs
byPeter Steinberger@steipete
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
The skill's name/description match the included Python script and SKILL.md: it summarizes CodexBar local cost JSON by model. One minor inconsistency: the registry metadata at the top of the evaluation lists no required binaries, but the SKILL.md metadata and the script expect the 'codexbar' CLI to be available (and provides a brew cask install hint). Functionally this is expected for the task, but the registry-level requirements should declare codexbar.
Instruction Scope
SKILL.md instructs running 'codexbar cost --format json' or providing a JSON file/stdin; the script either invokes the codexbar CLI or parses supplied JSON. The instructions do not request unrelated files, environment variables, or network endpoints. The references note where CodexBar stores local logs (~/.codex or ~/.config/claude), but the script itself does not directly read those paths — the codexbar CLI does. No instructions to transmit data to external endpoints are present.
Install Mechanism
There is no formal install spec in the registry entry, but the SKILL.md metadata suggests installing CodexBar via a Homebrew cask (steipete/tap/codexbar). Installing from a known Homebrew tap is standard; however this implies macOS-only guidance (SKILL.md metadata lists darwin) and the skill lacks explicit Linux instructions. No arbitrary URL downloads or archive extraction in the skill itself were found.
Credentials
The skill requests no environment variables, secrets, or config paths in the registry. The script only reads provided JSON, stdin, or runs the codexbar CLI; it does not read unrelated environment variables or request credentials.
Persistence & Privilege
always is false and the skill does not request persistent system-level presence or modify other skills' configuration. It runs a local script and invokes the codexbar CLI when asked; autonomous invocation is allowed by default but not unusual here.
Assessment
This skill appears to do what it says: run the CodexBar CLI (or parse cost JSON you supply) and summarize per-model costs locally. Before installing or running it: 1) Verify you trust the CodexBar CLI binary (the SKILL.md suggests a Homebrew tap 'steipete/tap/codexbar'); review that CLI's source or release channel so you know what it reads/transmits. 2) Note the small metadata mismatch: registry entry didn't list required binaries while SKILL.md expects 'codexbar' — ensure the platform will make the CLI available or pass cost JSON directly. 3) The script will parse any JSON you give it — don't feed it untrusted data you wouldn't want processed locally. 4) This skill has macOS installation guidance only; if you run Linux, check how you will obtain the codexbar output. If you confirm the CodexBar CLI is from a trusted source, the skill itself is coherent and limited in scope.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.0
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
📊 Clawdis
OSmacOS
Binscodexbar
Install
Install CodexBar (brew cask)
Bins: codexbar
SKILL.md
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.
TODO: add Linux CLI support guidance once CodexBar CLI install path is documented for Linux.
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>. - 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.
Files
3 totalSelect a file
Select a file to preview.
Comments
Loading comments…
