Skip to content

Document crush price flags in the casper cheatsheet - #195

Closed
alycda wants to merge 1 commit into
mainfrom
crush-casper-price-flags
Closed

alycda wants to merge 1 commit into
mainfrom
crush-casper-price-flags

Conversation

@alycda

@alycda alycda commented Oct 1, 2026

Copy link
Copy Markdown
Owner

What

Adds the four --price-* flags to the model add example in tools/cheat/cheatsheets/personal/crush/casper, as placeholders, with a note on where the real numbers belong.

Why

crush computes session cost only from per-model cost_per_1m_* rates (internal/agent/agent.go, updateSessionUsage). A custom provider with none set shows $0.00 forever, so casper needs prices supplied by hand.

Where the numbers live: only in the hand-managed ~/.config/crush/crushrc. If they are casper's internal rates, they stay out of this public repo entirely, agenix included. This follows the existing casper rule ("never committed, not even encrypted"). It also fits the mechanics: agenix decrypts at activation, but crush.json is built at eval time.

Naming trap, now recorded: --price-cache-create writes cost_per_1m_in_cached, which is billed against cache writes. --price-cache-hit writes cost_per_1m_out_cached, which is billed against cache reads, not output tokens.

Verification

  • Flag names and JSON keys come from internal/shellconfig/model.go and the cost formula from agent.go, both on crush main at 76cc5c5 (2026-09-30). I have not checked them against the crush version charm-nur pins. Run model add with no arguments in your installed crush; the usage line lists the flags.
  • The change is a cheatsheet comment only, with no Nix change, so lint and check are unaffected.

🤖 Generated with Claude Code

https://claude.ai/code/session_016D2WAsAGBJZHkbWegd613b


Generated by Claude Code

crush computes session cost purely from per-model cost_per_1m_* rates in
config; a custom provider like casper with none set shows $0.00 forever.
The `model add` example now carries the four --price-* flags as
placeholders so the sidebar figure can be made meaningful.

The real numbers deliberately stay in the hand-managed crushrc. If they
are casper's internal rates they are employer-confidential, and the
existing rule for casper (the API key is never committed, not even
encrypted) applies: a public ciphertext is permanent, and agenix
decrypts at activation while crush.json is built at eval time, so it
would not fit mechanically either.

Also records crush's misleading cached-cost names: --price-cache-create
writes cost_per_1m_in_cached and --price-cache-hit writes
cost_per_1m_out_cached, which is billed against cache-read tokens, not
output (internal/agent/agent.go updateSessionUsage, crush main 76cc5c5).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016D2WAsAGBJZHkbWegd613b
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

⊕ Entity-level changes

tools/cheat/cheatsheets/personal/crush/casper

Status Type Name
Δ chunk lines 1-20
- chunk lines 21-26
+ chunk lines 21-37

Summary: 1 added, 1 modified, 1 deleted across 1 file

functions and classes, not lines · sem

@alycda alycda closed this Oct 6, 2026
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.

2 participants