costlisted
Install: claude install-skill gaia-research/skill-cost
# cost — Multi-Harness Token Cost Report
Reads session usage records written by AI agent harnesses on this machine
and reports persisted token usage plus a **public-rate USD estimate** per session. Prices come
from [BerriAI/litellm](https://github.com/BerriAI/litellm)'s canonical
`model_prices_and_context_window.json` catalog and auto-refresh weekly.
## Supported harnesses
Auto-detected from `~`:
| Harness | Session storage |
|--------------|-----------------------------------------|
| pi | `~/.pi/agent/sessions/**/*.jsonl` |
| Claude Code | `~/.claude/projects/**/*.jsonl` |
| OpenAI Codex | `~/.codex/sessions/**/*.jsonl` |
| opencode | `~/.local/share/opencode/**/*.jsonl` |
| Hermes Agent | `$HERMES_HOME/state.db` |
Hermes is read through SQLite in `mode=ro`. The parser queries only `sessions`
and `session_model_usage`; it never reads transcript rows from `messages`.
Adding a new line-oriented harness = one small `parse_*` function in `cost.py`.
## Run
```bash
# [default] the newest logical session across all harnesses
python3 cost.py
# Latest session per harness in current cwd
python3 cost.py --latest
# Every session across every harness
python3 cost.py --all --list
# Today only, per-model breakdown
python3 cost.py --today --by-model
# Since a date, one harness only
python3 cost.py --since 2026-07-01 --harness claude-code
python3 cost.py --harness hermes
# Filter by working di