agentsclimarketplace

Cost awareness

Skill aarshsharma2803-stack/optimusprime/skills/cost-awareness

The session state protocol for AI coding. Hook-level scope enforcement, cross-session memory, contradiction detection, and predictive context - Claude is stateless, your project isn't.

Install
npx -y skills add aarshsharma2803-stack/optimusprime --skill cost-awareness

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Activates when user asks about token usage or cost: "how much has this session cost", "what's my token usage", "am I close to my budget", "cost report", "how many tokens", "what have I spent", "token count", "check my usage". Also activates proactively when session shows very high token consumption: responses consistently exceeding 400 lines, more than 15 tool calls in one turn, or user mentions slow responses, context limits, or approaching compaction.

SKILL.md

1.3 KB, as published. Nobody here has run it

Read .optimusprime/cost-log.json (walk up from cwd to find .optimusprime/).

Estimate current session tokens from context window size (4 chars ≈ 1 token).

Output:

COST REPORT — Session: ~Xk in / ~Yk out | ~$Z.ZZ (Sonnet 4 pricing: $3/M in, $15/M out)
Previous sessions: N total | ~$W.WW cumulative

Budget alert based on complexity_budget in contract.json:

  • minimal + usage > 20k tokens → warn
  • moderate + usage > 60k tokens → warn
  • full + usage > 150k tokens → warn

Alert: COST ALERT: ~$X.XX used this session — over [minimal/moderate/full] budget

Append to .optimusprime/cost-log.json (create if missing):

{"session_id": "...", "estimated_input_tokens": N, "estimated_output_tokens": N, "estimated_cost_usd": N, "recorded_at": "ISO 8601"}

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.