| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
`moshcode cost` answers the other question you have with six agents running. The roster says which one is blocked; this says what it costs. Nothing is instrumented and nothing is proxied — every engine already writes its own usage down, so this reads what is on disk: Claude Code's per-message `usage` in ~/.claude/projects, Codex's cumulative `token_count` events, opencode's per-message `cost`, and the running session total aider prints into its chat history. A price the engine computed is reported untouched; only token-only engines are multiplied by a rate card, and those figures are marked `~` because on a subscription they are "what this would cost on the API", not a bill. A model nobody has priced shows its tokens and no cost rather than a convincing zero — ~/.moshcode/pricing.json takes your own rates. Cache tokens get their own column: they are most of the traffic and a tenth of the price, and folding them into `in` makes a $3 session look like a $60 one. Attribution to a herd session is engine + directory + started-before, which is right for one agent per directory and can be wrong when two share one; --json carries the run list so it stays checkable. gemini, kimi, qwen, deepseek and openagents log nothing readable, so they report no cost rather than zero cost. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan3 finding(s) in the files this PR changes MEDIUM: 3
Snippets are redacted; ThreatCrush never prints matched credential material. 50 further finding(s) elsewhere in the repository are not shown: they are pre-existing and untouched by this PR. The full tree was scanned — see the Security tab. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
moshcode ps says which agent is blocked. moshcode cost says what the herd is spending — read out of the agent CLIs' own session logs, so nothing has to be instrumented, wrapped or proxied.
Where the numbers come from
Decisions worth reviewing
Surface
Also moshcode herd cost, /cost in the pit, and cost(...) in moshscript. --all works with no herd at all, which covers foreground moshcode agents claude runs.
Performance
Bounded by mtime and, where the layout allows it, by directory and date before any file is opened; Codex rollouts are read head-and-tail rather than whole. On a box with ~600 Claude transcripts, cost --all --since 6h returns in ~0.7s.
Tests
39 new tests in test/cost.test.mjs — pricing and rate matching (dated snapshots, provider prefixes, user overrides), each reader against a throwaway $HOME, dedupe, <synthetic>, window and cwd filtering, malformed lines, aider parsing, attribution edge cases, and the CLI end-to-end via --json. Full suite green: 2084 tests, 0 failures. The README command table was regenerated from the schema.
🤖 Generated with Claude Code