
Cost Compact Context
Shells a Node one-liner to call getTokenOptimizer().getCompactContext() from the agentic-flow bridge, giving you a markdown table with memories retrieved and tokens saved for cost-analysis queries. The "tokens saved" number is bridge-reported heuristic math (query tokens minus compact prompt tokens), not measured against a no-RAG baseline, though the root CLAUDE.md claims 32% savings from ReasoningBank retrieval. If agentic-flow isn't installed, it gracefully returns zero savings and exits cleanly. Useful when you want to see what the token optimizer is doing under the hood, but take the savings claim with a grain of salt until you see benchmarks.
- skills.sh installs
- 726
- GitHub stars
- 81.4K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add ruvnet/ruflo --skill cost-compact-context --agent claude-codeInstalls into .claude/skills of the current project.
Files
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.
Sponsors
Details
- Repository
- github.com/ruvnet/ruflo
- First seen
- Jun 3, 2026
More from ruvnet/ruflo
All 236- Market Ingest726
- Vector Hyperbolic725
- Browser Replay721
- Browser Record719
- Browser Form Fill718
- Dossier Collect702
- Browser Extract698
- Browser Screenshot Diff697
- Cost Budget Check693
- Browser Auth Flow690
- Adr Verify688
- Cost Track685
- Cost Booster Route684
- Cost Federation684
- Cost Summary684
- Intelligence Transfer684
- Vector Setup684
- Cost Trend683
- Cost Conversation682
- Cost Export681
- Cost Benchmark679
- Cost Booster Edit679
- Browser674
- Witness656