Skip to content

feat: /cost-report shows what Opus sessions would have cost on Sonnet - #19

Merged
mauricios merged 1 commit into
mainfrom
feat/cost-report-sonnet-estimate
Oct 2, 2026
Merged

mauricios merged 1 commit into
mainfrom
feat/cost-report-sonnet-estimate

Conversation

@mauricios

Copy link
Copy Markdown
Contributor

What changed and why

A pilot project's /cost-report showed all four recent sessions on Opus, although the project's .claude/settings.json says "model": "sonnet". The desktop app's model picker sets each session's model. The cost model already says "Sonnet for work with a clear spec and a way to check it", but the report gave that advice no number.

/cost-report now re-prices each Opus or Fable session's tokens at Sonnet's prices:

  • An on sonnet column, for sessions above Sonnet only. Sonnet and Haiku sessions show -.
  • A model line: how many sessions ran above Sonnet, their cost, the same tokens on Sonnet, and the percentage less. Under it, a reminder of which work fits Sonnet. It also notes that cache reads cost the same on both, so in long sessions context size matters as much as the model.
  • --json adds cost_on_sonnet.

On the pilot's last two days, the model line read: 4 sessions ran above Sonnet (≈ $29.34); the same tokens on Sonnet ≈ $21.49, 27% less.

The skill's instructions now explain the column and say to pick Sonnet in the desktop app's picker or with /model, since the picker overrides the project setting. They also add a rule: the column compares prices, it doesn't predict cost. A session on Sonnet could take a different number of turns, and only the session's work says whether it needed Opus.

Plugin 0.2.6. The plugin README and the main README mention it.

Upgrade impact

Framework-internal: update the plugin.

How to verify

  1. Run ./evals/run-evals.sh. The plugin suite has two new checks: an Opus session re-priced at Sonnet's prices ($0.25 → $0.18, worked out by hand), a Sonnet session left unchanged, and the column and model line in the output.
  2. Run python3 plugins/aplyca-framework/skills/cost-report/session_cost.py <a project> --days 7 on a project with Opus sessions.

Verified / not verified

  • Verified: static suites 131, 71, 45, and 11 pass; claude plugin validate passes; checked by hand against the pilot's real transcripts.
  • Not verified: nothing else; the change is a local script and its docs.

🤖 Generated with Claude Code

A pilot's report showed every session on Opus although the project's
model setting said sonnet: the desktop app's model picker sets each
session's model. The report now re-prices each Opus or Fable session's
tokens at Sonnet's prices — an "on sonnet" column, and a model line with
the total and the difference — and the skill ties it to the cost
model's rule. Cache reads cost the same on both, so the report notes
that context size matters as much in long sessions. --json adds
cost_on_sonnet. aplyca-framework 0.2.6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mauricios
mauricios marked this pull request as ready for review October 2, 2026 05:26
@mauricios
mauricios merged commit 99d26ad into main Oct 2, 2026
1 check passed
@mauricios
mauricios deleted the feat/cost-report-sonnet-estimate branch October 2, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant