ruvnet/ruflo/cost-session
Claude Code and agent skill by ruvnet/ruflo
- community
Checking that the SKILL.md file is still in the repository.
Per-message cost breakdown within a single session. The drill-down companion to cost-anomaly — when an outlier session is flagged, this surfaces the specific expensive messages so operators can see whether the cost came from output tokens, cache writes, or model escalations.
Install
npx vskill@latest install ruvnet/ruflo/cost-sessionSKILL.md
The same SKILL.md was published earlier as ruvnet/ruflo/cost-session.
When cost-anomaly flags a session as a >3.5σ outlier, the next question is "which MESSAGES were expensive?". cost-session answers that.
| Question | Skill | |
|---|---|---|
| "Which sessions cost the most?" | cost-conversation | |
| "Which sessions are outliers?" | cost-anomaly | |
| "Which messages in THIS session were expensive?" | `cost-session` ← this |
Algorithm
Implementation: `scripts/session.mjs`.
- Resolve session jsonl:
--session-id <id>(scans~/.claude/projects/*/)
or --latest (default; picks most-recently-modified jsonl).
- Parse all assistant messages with
usageblocks. - Cost each message via shared PRICING (
_prices.mjs). - Sort descending by
cost_usd, surface top-N (default 20). - Compute p50/p90/p99 of message costs for in-session percentile context.
- Flag the top message if it's >2× the p99 — that's an in-session outlier.
Why this matters: cache writes are the silent cost
Example real session, top message:
Without the Cache W column it looks like "569 output tokens cost $16" — that's wrong by 380×. The actual cost is ephemeral 1h cache write at opus pricing: 881,898 tokens × $18.75/1M = $16.54.
Operators reading the table see immediately: "the model wrote 881K tokens to ephemeral cache". From there the question becomes "why did we cache 881K tokens of context for a 6-input request?" — that's a real engineering signal.
Drill-down workflow
Percentile context
Top of output:
Lets operators ask "is this top message a 2× outlier or a 380× one?" without having to compute it themselves. The "top is >2× p99" footer fires when the answer is "yes, this is an in-session outlier worth investigating".
--since filter
Useful for drilling into a specific time range within a long session:
Only messages with timestamp >= --since are considered.
Edge cases
- No costed assistant messages → "_No costed assistant messages_" + exit 0.
--session-idnot found in any project's jsonls → exit 2 with error.--topmust be a positive integer → exit 2.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/ruflo-cost-tracker/skills/cost-session/SKILL.md
Popularity
- Repository stars
- 59,801
- Repository forks
- 6,923
- 7-day trend score
- 55
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ruvnet/ruflo/cost-session)