Skip to content
Skillpedia
Misc81k Β· #1596

cost-compact-context

What it does

This skill fetches a condensed set of remembered context for a question about AI costs. It is for people who want their AI to read less text when it answers.

When to use it

  • βœ“When you ask a cost question that depends on past notes.
  • βœ“When you want to reduce how much text your AI reads for a lookup.
  • βœ“When you want to see the savings the context tool reports.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-compact-context/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œPull a short summary of what I decided about our AI cost limits.”

5 new skills a week. 1 minute to read.

How it works

The skill calls a helper that retrieves compacted notes for your question from a stored memory bank. If the optional helper package is not installed, it returns empty results and exits cleanly.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Cost Compact Context

Wraps getTokenOptimizer().getCompactContext() from @claude-flow/integration for cost-analysis queries. The bridge dynamically imports agentic-flow with graceful fallback: when the package isn't installed, tokensSaved is 0 and the skill exits cleanly. No MCP tool wraps getTokenOptimizer today (ADR-0002 Β§"Riskiest assumption"); we shell a Node one-liner instead.

Steps

  1. Take the query β€” the single argument.

  2. Invoke β€” run from anywhere under v3/ so @claude-flow/integration resolves:

    ( cd v3 && node ../plugins/ruflo-cost-tracker/scripts/compact.mjs "<QUERY>" )
    

    The script imports @claude-flow/integration/token-optimizer (canonical export β€” not dist/token-optimizer.js, which would double the .js extension via Node's ./* exports rule), calls getCompactContext(query), and prints a markdown summary plus a JSON line via COMPACT_QUIET=1.

  3. Report β€” markdown table with: memories retrieved, tokens saved (bridge-reported), agentic-flow availability, cache hit rate. The script also emits a "bridge-reported, not measured against a no-RAG baseline" disclaimer. On bridge-unavailable: prints "agentic-flow not installed β€” bridge returns inert results." and exits cleanly.

Caveats β€” claimed upstream, not yet verified

CLAUDE.md root claims ReasoningBank retrieval: -32% tokens. The bridge's tokensSaved is query_tokens βˆ’ compact_prompt_tokens (token-optimizer.ts:141–143) β€” a heuristic, not a baseline-measured saving. token-optimizer.ts:9–10 itself says: "No fabricated metrics are reported β€” all stats reflect real measurements". This skill carries that disclaimer forward.

Booster-specific availability is not exposed as a getter β€” observable only through optimizedEdit() returning method: 'agent-booster'. The canonical Tier 1 signal is [AGENT_BOOSTER_AVAILABLE] (see cost-booster-route).

Fallback

agentic-flow not installed β†’ getCompactContext returns {tokensSaved: 0, memories: []} (line 116–124), optimizedEdit returns {method: 'traditional'}, getOptimalConfig falls back to anti-drift defaults. Skill exits cleanly with the "not available" message.

Cross-references

ADR-0002 Decision #2 + Β§"Riskiest assumption" Β· token-optimizer.ts:308 (singleton export) Β· docs/benchmarks/0002-baseline.md (verification findings).

FAQ

What happens if the helper package is missing?

The skill says the package is not installed and returns empty results, without failing.

Are the savings verified?

Not yet. The savings are reported by the helper and are not yet measured against a baseline without context.

Where does the context come from?

It comes from the stored memory bank that the helper searches.

Details

Original description by the author

Wrap getTokenOptimizer().getCompactContext() to retrieve compacted ReasoningBank context for cost-analysis queries; report bridge-reported tokensSaved

repo: ruvnet/ruflo

Popularity

GitHub stars
81k
Ranking position
#1596
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills