Rubi

Only what's precious stays in context. Rubi keeps Claude sessions short on its own, saves a handoff before every compaction and brings it back right after. You spend fewer tokens and never lose the thread.

How much of your Claude is just re-reading?

Run /stats in Claude Code and type two numbers from it. Nothing leaves your browser.

Accepts 44.5b, 812m, 350k or plain numbers. The example is the author's real usage since March 2026.

re-reading the conversationactual new work
–
of your tokens were Claude re-reading the conversation
–
tokens re-read
–
tokens Rubi would spare you (conservative projection, −20%)
–
more work from the same usage limit

One session, two timelines

Every message re-sends the whole conversation. Watch the same long session with and without Rubi. Drag the sliders to match how you work.

Without RubiWith RubiHandoff saved (80%)

Without Rubi 0

Cost so far 0Compactions 0

With Rubi 0

Cost so far 0Handoffs 0
0%

fewer tokens billed in this session

Cost is in input-token equivalents (cache read 0.1×, cache write 1.25×, output 5×) using Anthropic's price ratios, so it holds for any model or plan. Across 30 days of real usage (284 sessions, short ones included), the measured saving was about one third.

How it works

Four hooks and a markdown vault. No server, no database, no dependencies beyond Node.

Compact early

Claude Code compacts on its own at 150k instead of near 1M. You never type /clear.

Meter

At 80% of the window, a hook tells Claude to save a handoff: goal, decisions, key files, next step.

Record

Right before compaction, Rubi writes what's about to vanish: your requests, files changed, commands run.

Restore

Right after, the handoff is injected back. Claude carries on from ~60k tokens instead of 500k+.

Install

Pick where you use Claude.

  1. Add and install the plugin inside Claude Code:
> /plugin marketplace add YURIBEDRAN/rubi
> /plugin install rubi@rubi
  1. Turn on early compaction and pick your vault folder:
$ git clone https://github.com/YURIBEDRAN/rubi && cd rubi
$ node scripts/instalar.mjs
  1. That's it. Work normally. Try /rubi:raio-x to see where your tokens go.
  1. Download rubi.mcpb from Releases.
  2. Open it with Claude Desktop and choose a vault folder (an Obsidian vault works).
  3. In the app, Rubi provides the memory: knowledge graph, search and handoffs. The code map and automatic hooks need Claude Code.
  1. Clone Rubi, then run the connector from inside your project:
$ git clone https://github.com/YURIBEDRAN/rubi
$ node rubi/scripts/conectar.mjs codex
  1. Swap codex for gemini, cursor, vscode, windsurf, cline, opencode, continue, goose or zed.
  2. It registers the MCP server, writes the instructions file and, in Codex and Gemini CLI, turns on the automatic map and recall hooks.
  3. Works with local models (Ollama, LM Studio) in Codex, Cline, OpenCode, Continue, Goose and Zed. Use models with tool calling, 8B+.
  1. Coming soon. Support for the website and the mobile app is in development.
  2. Follow the repository to know when it ships.