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.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
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
Take the query β the single argument.
Invoke β run from anywhere under
v3/so@claude-flow/integrationresolves:( cd v3 && node ../plugins/ruflo-cost-tracker/scripts/compact.mjs "<QUERY>" )The script imports
@claude-flow/integration/token-optimizer(canonical export β notdist/token-optimizer.js, which would double the.jsextension via Node's./*exports rule), callsgetCompactContext(query), and prints a markdown summary plus a JSON line viaCOMPACT_QUIET=1.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
Comments
- β¦
More skills from this repository
agent-adaptive-coordinator
81kHelps your agent split and rebalance a group of AI agents as the workload changes, choosing a layout that fits the task.
agent-agent
81kTeaches your agent to turn a big goal into an ordered plan of actions, and to replan when conditions change.
agent-agentic-payments
81kHelps your agent manage spending mandates for AI shopping, with spend caps, time windows, merchant rules and signed approvals.
agent-analyze-code-quality
81kHelps your agent review code for quality, finding code smells, technical debt and refactoring ideas without changing the files.
Similar skills
blucli
394kHelps your agent find, play, pause, group, and adjust the volume of Bluesound and NAD speakers through the blu command.
camsnap
394kHelps your agent grab snapshots, short clips, or motion events from network cameras and local webcams that you have set up.
eightctl
394kHelps your agent check and control an Eight Sleep pod, including its temperature, alarms, and sleep schedules.