feat: /cost-report shows what Opus sessions would have cost on Sonnet - #19
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
A pilot project's
/cost-reportshowed all four recent sessions on Opus, although the project's.claude/settings.jsonsays"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-reportnow re-prices each Opus or Fable session's tokens at Sonnet's prices:on sonnetcolumn, for sessions above Sonnet only. Sonnet and Haiku sessions show-.--jsonaddscost_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
./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.python3 plugins/aplyca-framework/skills/cost-report/session_cost.py <a project> --days 7on a project with Opus sessions.Verified / not verified
claude plugin validatepasses; checked by hand against the pilot's real transcripts.🤖 Generated with Claude Code