मुख्य सामग्री पर जाएँ
Skillpedia
विविध81k · #1609

cost-session

यह क्या करती है

यह स्किल एक AI सत्र को संदेश-दर-संदेश तोड़कर दिखाती है कि कौन से जवाब सबसे महँगे रहे। जो लोग समझना चाहते हैं कि एक सत्र इतना महँगा क्यों था, उनके लिए यह है।

कब इस्तेमाल करें

  • ✓जब कोई सत्र असामान्य रूप से महँगा चिह्नित हो और आपको कारण चाहिए।
  • ✓जब आप अपने ताज़ा सत्र के सबसे महँगे संदेश देखना चाहें।
  • ✓जब आप जानना चाहें कि कैश राइट ने लागत का बड़ा हिस्सा बनाया या नहीं।

Skill का लिंक

https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-session/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-session/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे पिछले AI सत्र में कौन से संदेश सबसे महँगे रहे, और क्यों?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

स्किल सत्र लॉग पढ़ती है, हर जवाब की कीमत उसके टोकन प्रकारों से निकालती है और जवाबों को सबसे महँगे से सबसे सस्ते तक छाँटती है। जो जवाब उस सत्र की आम लागत से बहुत ऊपर हो, उसे भी चिह्नित किया जाता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

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.

  1. Resolve session jsonl: --session-id <id> (scans ~/.claude/projects/*/) or --latest (default; picks most-recently-modified jsonl).
  2. Parse all assistant messages with usage blocks.
  3. Cost each message via shared PRICING (_prices.mjs).
  4. Sort descending by cost_usd, surface top-N (default 20).
  5. Compute p50/p90/p99 of message costs for in-session percentile context.
  6. 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:

| # | Model    | In | Out | Cache W | Cache R | Cost      |
| 1 | opus-4-7 | 6  | 569 | 881898  | 0       | $16.58    |

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

# Step 1: find outliers across all sessions
cost anomaly --alert-on-outliers 1 || cost anomaly  # see which session-ids

# Step 2: drill into the flagged session
cost session --session-id <flagged-id> --top 10

# Step 3: open that jsonl at the timestamp the top message reports,
# inspect the prompt + tool calls

Percentile context

Top of output:

| p50 (median) message | $0.85 |
| p90 message          | $1.45 |
| p99 message          | $1.74 |

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:

cost session --since 2026-06-16T13:00:00Z --top 5

Only messages with timestamp >= --since are considered.

Edge cases

  • No costed assistant messages → "No costed assistant messages" + exit 0.
  • --session-id not found in any project's jsonls → exit 2 with error.
  • --top must be a positive integer → exit 2.
अक्सर पूछे जाने वाले सवाल

क्या मैं कोई खास सत्र चुन सकता हूँ?

हाँ। आप सत्र ID दे सकते हैं, या डिफ़ॉल्ट रूप से यह सबसे हाल में बदला गया सत्र लेती है।

कितने संदेश दिखते हैं?

डिफ़ॉल्ट रूप से शीर्ष 20, और आप दूसरी संख्या चुन सकते हैं।

कैश राइट क्यों मायने रखते हैं?

कैश राइट एक बड़ी लागत जोड़ सकते हैं, जो आउटपुट का आकार देखने पर आसानी से छूट जाती है।

जानकारी

लेखक का मूल विवरण

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.

repo: ruvnet/ruflo

लोकप्रियता

GitHub स्टार
81k
रैंकिंग में स्थान
#1609
लाइसेंस
MIT
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

agent-adaptive-coordinator

81k

आपके एजेंट को काम बदलने पर AI एजेंटों के समूह को बाँटने और फिर से संतुलित करने में मदद करती है, और काम के हिसाब से लेआउट चुनती है।

AI और एजेंटएजेंट

agent-agent

81k

आपके एजेंट को बड़े लक्ष्य को क्रमबद्ध कार्यों की योजना में बदलना सिखाती है, और स्थिति बदलने पर योजना फिर से बनाना भी।

AI और एजेंटएजेंट

agent-agentic-payments

81k

AI खरीदारी के लिए खर्च के आदेश मैनेज करने में मदद करती है, जिसमें खर्च की सीमा, समय अवधि, व्यापारी नियम और signed मंज़ूरियाँ शामिल हैं।

AI और एजेंटएजेंट

agent-analyze-code-quality

81k

आपके एजेंट को कोड की गुणवत्ता जाँचने में मदद करती है, बिना फ़ाइलें बदले code smells, technical debt और refactoring के सुझाव खोजकर।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills