Skip to content

docs(readme): update the savings figure with live numbers and presets - #935

Merged
OsherElhadad merged 4 commits into
mainfrom
docs/readme-savings-figure
Nov 6, 2026
Merged

OsherElhadad merged 4 commits into
mainfrom
docs/readme-savings-figure

Conversation

@OsherElhadad

@OsherElhadad OsherElhadad commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Updates the four-box figure at the top of the README. It now has new numbers, the preset that turns on each feature, and a light and a dark version.

What changed

  • Headline: 5–15% → 15–30%.
  • Smart cache management: 5–10% → 15–20%. Preset chip: default.
  • Compaction when it matters: ~2% → 5–10%. The "experimental" label is gone. The box splits into two parts, as David suggested:
    • Summarize early: medium/high.
    • Sweep cold turns: xhigh.
  • Tools box: "Unused MCP tools & skills, 2–4%" → "Tool search for MCP & skills", 2–5%. Chip: ultrahigh · experimental.
  • Smaller tool outputs: 0.5% → ~1%. Chip: conservative.
  • A line above the boxes shows how the four add up: ~1% + 2–5% + 5–10% + 15–20% = 15–30%. A note says the savings overlap.
  • The two compaction pills use the blue-to-orange gradient, so they stand out.
  • Each number has a bar on the same 0–30% scale. A light part on the bar shows the top of a range.
  • The README uses <picture>, so GitHub dark mode shows the dark PNG.
  • The figure source is docs/img/readme/savings-figure.html. scripts/render-savings-figure.sh renders both PNGs with headless Chromium and Pillow.
  • Removes the old docs/img/context_guru_stats_sqaure.png. Nothing else uses it.

Where the numbers come from

Live data on contextguru2, preset xhigh, 2026-11-04 to 2026-11-06. That covers 14.8k requests, 202 sessions and $1,450 of spend plus savings.

Window Total saved Keep-alive (net) Compaction
11-04 (after deploy) 19.8% 14.8% 5.0%
11-05 15.7% 9.2% 6.1%
  • Compaction: the figure says 5–10% (David's number). We measured about 5% on xhigh.
  • The sweep (extract_llm_sweep) makes up $72 of the $80 that compaction saved.
  • The tool-output components (searchfold, textclean, dedup and others) add up to about $8, or ~0.5–1%.
  • Cache: the measured net keep-alive saving is 9–15%. The 15–20% in the figure is the target number from the Slack thread. It is higher than what we measured.
  • Tool search: there are no live numbers yet, because ultrahigh is off on contextguru2. The 2–5% is David's number. The replay on toolfilter: defer unused tool declarations at session start, by history (was: remove at cold moments) #485 measured 5.9% of spend for the user-history rule.

Open questions

  • Do we keep 15–20% for cache, or show 10–15% to match the measured number?
  • The headline 15–30% assumes tool search is on. Without it, we measured 16–20%.

How it was tested

  • Rendered both themes and checked them by eye (no clipped text, no overlaps).
  • git grep context_guru_stats_sqaure finds no matches.

🤖 Generated with Claude Code

Replace the four-box figure with a light and dark version rendered from
HTML. New numbers from contextguru2 (xhigh, 2026-11-04..06): cache
management 15-20%, compaction ~5%, total 15-30% with tool search.
The compaction box splits into summarize (medium, high) and sweep (xhigh).
The tools box now shows tool search (ultrahigh, experimental) at 5-10%.

Assisted-By: Claude Opus 5.5
Signed-off-by: Osher Elhadad <[email protected]>

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @OsherElhadad) Claude Code 2.1.319 offload-review skill, @OsherElhadad's session fresh 2 of 2 1 of 2 95622f36af8c blocking

Verdict: blocking

Findings

  1. docs/get-started/how-it-saves.md:3 — the docs page still shows the old numbers, so the README and the docs now disagree

    • What fails: The README figure says 15–30%. The README links to the docs site. The "How it saves money" page (nav: Get started) still says the old numbers. A reader sees two different claims for the same four ways.
    • Proof:
      • how-it-saves.md:3: "saves 5–15% of your API cost in four ways". The figure says 15–30%.
      • :26: tool outputs "−0.5%". The figure says ~1%.
      • :29 and :47: tab "Unused MCP tools & skills", "2–4%". The figure says "Tool search for MCP & skills", 5–10%.
      • :52 and :71: "Compaction when it matters (experimental)", "~2%". The figure says ~5% and drops "experimental".
      • :99: cache "5–10% lower input cost". The figure says 15–20%.
      • git grep 5–15 finds only how-it-saves.md:3 now.
    • Fix: Update how-it-saves.md in this PR to the same numbers, names and labels as the figure. The tools tab should also describe tool search (ultrahigh, defer: auto), not the remove: list.
  2. docs/img/readme/savings-figure.html:86 — the cache number (15–20%) is above what the PR measured (9–15%), and the headline depends on it

    • What fails: The README shows a saving that the PR's own data does not support. A user who turns on the cache feature and measures 9–15% sees a number lower than the README claim.
    • Proof:
      • PR body table: keep-alive net 14.8% (11-04) and 9.2% (11-05).
      • PR body: "The 15–20% in the figure is the target number from the Slack thread. It is higher than what we measured."
      • The headline 15–30% also assumes tool search. The PR says ultrahigh has no live numbers, and the measured total without it is 16–20%.
      • The PR lists both points as open questions. A human must decide them before merge. A published number must not wait on an open question.
    • Fix: Use the measured range (for example 10–15% for cache), or label 15–20% as a target in the figure. Get the owner's answer on the headline before merge.

Non-blocking

  • "default" chip on cache (savings-figure.html:82). It is correct for the plugin (Cache strategy: auto). It is not correct for a self-hosted proxy: config.go:99 keeps KeepAlive off by default ("a consent decision, not a default"). Consider "default (plugin)", or a short note.
  • Compaction ~5% (savings-figure.html:68-75). The PR says the sweep made $72 of the $80. The sweep runs only in xhigh and up. A medium/high user gets much less than ~5%. Consider a split number per part, or a note that the ~5% is from xhigh.
  • Render script, no browser (scripts/render-savings-figure.sh:6). With set -e, a failed command -v chain ends the script with no message. Consider : "${CHROME:?set CHROME to a Chromium binary}".
  • Render script, empty image (:21-22). getbbox() returns None if the screenshot is all background, so box[3] raises TypeError. A clear error would help.
  • Fonts need network (savings-figure.html:4). An offline render falls back to a different font, so the PNGs change. Consider a note in the script header.
  • Published HTML file. docs/img/readme/ is in docs_dir, so mkdocs copies savings-figure.html to the site as a static page. It is harmless. You can add it to exclude_docs if you do not want it published.

What I checked

  • The full diff of the one commit 95622f36 (6 files): README, HTML source, render script, two new PNGs, one deleted PNG.
  • The README <picture> markup: the dark srcset and the light fallback paths exist. The alt text matches the figure numbers.
  • The deleted docs/img/context_guru_stats_sqaure.png: git grep finds no other references.
  • The bar widths against the 0–30% scale: 1%→3.3%, 5%→16.7%, 10%→33.3%, 15%→50%, 20%→66.7%. All correct.
  • The preset chips against config/config.go:665-673. conservative has no summarizer. medium/high add cache_aware_summarizer. xhigh adds extract_llm_sweep. ultrahigh adds tool deferral and is opt-in. The chips match.
  • docs/reference/presets.md:182: it still marks ultrahigh experimental, which matches the chip.
  • The PNG sizes: both are 2400×2254 (1200 px at 2× scale), about 388 KB each.
  • No code change, no behavior change, no data-dependence change. The fail-open rules do not apply.
  • I did not render the HTML. Live tests are not approved, and I did not look at the PNG pixels.

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @OsherElhadad) Claude Code 2.1.319 offload-review skill, @OsherElhadad's session fresh 1 of 2 1 of 2 95622f36af8c blocking

Verdict: blocking

The PR has no code change. The findings are about public claims that disagree with other docs and with the PR's own data.

Findings

  1. docs/get-started/how-it-saves.md:3 — the docs page still shows the old numbers, so README and docs now disagree

    • What fails: a reader sees 15–30% in the README, clicks the README link at README.md:133, and reads 5–15% on the docs page. The page is also on the docs site (mkdocs.yml:122).
    • Proof: how-it-saves.md still says:
      • line 3: "5–15% of your API cost in four ways" (figure: 15–30%).
      • line 41: cache "5–10% lower input cost" (figure: 15–20%).
      • line 51/71: compaction "(experimental)", "~2%" (figure: ~5%, no experimental label).
      • line 29–49: tab "Unused MCP tools & skills", toolfilter remove:, "2–4%" (figure: tool search, ultrahigh, 5–10%).
      • line 27: tool outputs "−0.5%" (figure: ~1%).
    • Fix: update how-it-saves.md in this PR to the same numbers, names and labels. Or keep the old figure until both change together.
  2. docs/img/readme/savings-figure.html:47 — the headline adds numbers that the docs say do not add, and two of them are not measured

    • What fails: the README says "saves 15–30%" as a fact. The PR body's own data does not support it:
      • Measured total on xhigh: 15.7% and 19.8%. The PR body says "without tool search, we measured 16–20%".
      • Cache 15–20% is "the target number from the Slack thread", above the measured 9–15% net keep-alive.
      • Tool search 5–10% has "no live numbers yet". ultrahigh is off on contextguru2. The only number is a 5.9% replay on #485.
      • how-it-saves.md:107-109 says the four "are separate baselines ... the four don't simply add up". The new headline is a sum.
    • Proof: PR body, sections "Where the numbers come from" and "Open questions"; how-it-saves.md:107-109.
    • Fix: show measured numbers (for example cache 10–15%, total 15–20%), or mark the unmeasured ones as "target" / "replay" on the figure. The author's own open questions point at this. A human must decide; do not merge with the open questions unanswered.
  3. docs/img/readme/savings-figure.html:84 — the default chip on cache management is true for the plugin only

    • What fails: a proxy user reads "default" and expects keep-alive with no config. On the proxy binary keep-alive is off by default.
    • Proof: docs/how-to/cache-keepalive.md:53: "It is off by default, because it spends the caller's own money". docs/reference/presets.md:185: the plugin's default saving is the auto cache strategy. README.md:104: "only keep-alive spends, if that's on".
    • Fix: change the chip to "plugin default", or add "on by default in the plugin" to the card text.

Non-blocking

  • scripts/render-savings-figure.sh:6: when no Chromium is found, CHROME is empty and the error is "command not found: ''". A short check with a clear message helps.
  • scripts/render-savings-figure.sh:21: getbbox() returns None for a page that is all background (for example a failed render). Then box[3] raises a TypeError with no hint.
  • savings-figure.html:4: the font loads from Google Fonts. Offline, Chromium falls back to sans-serif with no warning, and the PNGs change. Note it in the script header.
  • The compaction card is "Carry less · pay less" with a blue-to-red side bar, but its number and bar are blue only. This is a design choice, not a defect.

What I checked

  • Read the full diff (1 commit, 6 files): README.md, the HTML source, the render script, and both PNGs by eye (light and dark). No clipped text, no overlap.
  • Bar widths match the stated 0–30% scale: 1%→3.3%, 5%→16.7%, 10%→33.3%, 15%→50%, 20%→66.7%.
  • Preset names in the chips (conservative, medium, high, xhigh, ultrahigh) exist in config/config.go:665-673. The sweep (extract_llm_sweep) is in xhigh and ultrahigh only, as the figure says.
  • git grep context_guru_stats_sqaure finds nothing. The deleted PNG has no other user.
  • The <picture> markup and the alt text are correct. The alt text matches the figure.
  • No code, config or component change: fail open, data dependence and behavior-change rules do not apply.
  • Did not run the render script (no live tests approved).

- how-it-saves.md: same numbers, names and presets as the README figure;
  the tools tab now describes tool search (ultrahigh, defer: auto).
- Cache chip says "plugin default": the proxy binary keeps keep-alive off.
- Render script: clear errors for no Chromium and an empty render.
- Keep the figure HTML source out of the mkdocs site.

Assisted-By: Claude Opus 5.5
Signed-off-by: Osher Elhadad <[email protected]>
@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

Round 1 replies. Fixes are in 36fbd30.

R1-1 / R2-1: how-it-saves.md has the old numbers. Fixed. The page now uses the same numbers, names and presets as the figure. The tools tab now describes tool search (ultrahigh, defer: auto). The remove: list is one line at the end of the tab.

R1-2 / R2-2: the cache number and the headline are higher than what we measured. Not changed in this PR, on purpose. The owner (Osher) gave these numbers: cache 15–20%, tool search 5–10%. The PR body lists the measured numbers next to them. The docs page now says "Expected" for cache and tool search, and "Measured" only where the live data supports the number (tool outputs and compaction). A person decides on the open questions before merge.

R1-3 / R2 non-blocking: the default chip. Fixed. The chip now says plugin default. The docs page says that the proxy binary keeps keep-alive off until you turn it on.

R2 non-blocking: the ~5% compaction number comes from xhigh. Fixed in the docs page: "~5% lower cost on xhigh … medium and high save less." The figure keeps one number, to keep the text short.

Render script (no Chromium, empty render, font needs network). Fixed. There is a clear error for each case, and a note about the font in the script header and the HTML.

R2: mkdocs publishes the HTML source. Fixed. Added it to exclude_docs. mkdocs build --strict passes, and the site has only the two PNGs.

R1: the compaction number and bar are blue only. Kept as is. This is a design choice.

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (claude, user of @OsherElhadad) Claude Code 2.1.319 offload-review skill, @OsherElhadad's session resumed 2 of 2 2 of 2 36fbd30baa67 approve

Verdict: approve

The fix commit closes the docs mismatch. The author rejected the number finding with a reason I accept: the owner picked the numbers, and the docs page now labels them "Expected". No new defects.

Findings

None.

Status of round-1 findings

  • R2-1 / R1-1 (how-it-saves.md has old numbers): fixed. The headline, the four tab names, the numbers and the preset names now match the figure. The tools tab describes defer: auto and ultrahigh. The compaction tab drops "experimental" and splits into "Summarize early" and "Sweep cold turns". git grep finds no 5–15 or 2–4% left in the docs.
  • R2-2 / R1-2 (cache 15–20% and headline above the measured data): rejected by the author. I accept the reason. The owner chose the numbers. This is a claim choice, not a code defect. The docs page now separates "Measured" (tool outputs, compaction) from "Expected" (tool search, cache). The PR body still shows the measured numbers next to them. The two open questions are still in the PR body. A person should answer them or remove them before merge.
  • R1-3 / R2 non-blocking (default chip): fixed. The chip says plugin default. The docs page says that keep-alive on the proxy binary is off until you turn it on. This matches config/config.go:99 and docs/how-to/cache-keepalive.md.
  • R2 non-blocking (compaction ~5% is from xhigh): fixed in the docs page. The figure keeps one number. That is acceptable.
  • R1/R2 non-blocking (render script and font): fixed. See "What I checked".
  • R2 non-blocking (mkdocs publishes the HTML): fixed. img/readme/savings-figure.html is in exclude_docs.
  • R1 non-blocking (compaction bar is blue only): kept as a design choice. Accepted.

Non-blocking

  • The figure has no "expected" label. The docs page says "Expected" for cache (15–20%) and tool search (5–10%). The README figure shows both as plain "lower cost". A reader of the README alone sees no difference from the measured numbers. A small "expected" under those two numbers would match the docs page.
  • Footer of how-it-saves.md (:115-117). It still says "separate baselines measured independently — the four don't simply add up". Now two of the four are "Expected", not measured. The 15–30% headline at :3 is also a sum of the four. Consider "separate estimates" in the footer.

What I checked

  • Last review: round 1, 95622f36af8cb5b27f291ee907d0fe0d410a098f, 2026-11-06T11:46:36Z.
  • New commits read: 1. 36fbd30b docs: match how-it-saves.md to the new figure, review fixes (6 files).
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files).
  • New items since my last review:
    • Reviewer 1, round-1 review (11:46:38Z). I checked its 3 findings and 4 non-blocking points against the fix commit (see "Status of round-1 findings").
    • The author's reply comment (11:48:44Z). I checked each reply against the diff. All "fixed" claims are true in the code. I accepted the one rejection, with its reason.
    • Commit 36fbd30b. I read the full diff and the files around it.
  • how-it-saves.md: I read the whole page. The README anchor #experimental-ultrahigh matches README.md:122 (### Experimental: ultrahigh). The "decided once per thread" text matches docs/reference/presets.md:182.
  • render-savings-figure.sh: || true stops set -e from ending the script in the assignment. : "${CHROME:?...}" then gives a clear error for an empty value. if box is None: sys.exit(...) exits with code 1, and set -e stops the loop.
  • mkdocs.yml: the new exclude_docs line is relative to docs_dir, like the other lines.
  • Both new PNGs: 2400×2254. I looked at both by eye. There is no clipped text and no overlap. The plugin default chip fits. The dark version reads well.
  • No code, config or component change. The fail-open, data-dependence and behavior-change rules do not apply.
  • I did not run the render script or mkdocs build. Live tests are not approved.

@OsherElhadad OsherElhadad left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (claude, user of @OsherElhadad) Claude Code 2.1.319 offload-review skill, @OsherElhadad's session resumed 1 of 2 2 of 2 36fbd30baa67 approve

Verdict: approve

The fix commit closes every round-1 finding, or answers it with a valid reason. I found no new defect.

Earlier findings

  • R1-1 / R2-1 (how-it-saves.md has old numbers): fixed. The page now has the same numbers, names and presets as the figure: 15–30%, ~1%, 5–10% tool search, ~5% compaction with no "experimental" label, and 15–20% cache. The tools tab now describes ultrahigh / defer: auto. "Same set on every turn of a thread" matches docs/tool-search-matrix.md:36.
  • R1-2 / R2-2 (unmeasured cache and tool-search numbers): rejected by the author, reason accepted. The owner (a person, @OsherElhadad) chose these numbers. The docs page now labels them Expected, and uses Measured only for tool outputs and compaction. The PR body keeps the measured numbers and the open questions in plain view. This is a decision about a published claim, not a code defect, so a person makes it. I do not keep the finding.
  • R1-3 (default chip): fixed. The chip says plugin default in both PNGs (checked by eye). how-it-saves.md:110-112 says the proxy binary keeps keep-alive off. This matches docs/how-to/cache-keepalive.md:53.
  • R2 non-blocking (compaction ~5% is from xhigh): fixed in the docs page ("~5% lower cost on xhigh … medium and high save less").
  • Render script (no Chromium, empty render, font needs network): fixed. || true plus : "${CHROME:?…}" gives a clear error under set -euo pipefail. box is None now exits with a message. The font note is in the script header and the HTML comment.
  • R2 non-blocking (mkdocs publishes the HTML): fixed. mkdocs.yml exclude_docs now has img/readme/savings-figure.html. The path is relative to docs_dir, like the other entries.
  • R1 non-blocking (compaction number is blue only): kept by the author as a design choice. Accepted.

Non-blocking

  • docs/get-started/how-it-saves.md:116-118: the footnote still says "These are separate baselines measured independently — the four don't simply add up". Two of the four are now "Expected", not measured. Line 3 now gives a headline that is a sum (15–30%). Consider: "These are separate numbers, some measured and some expected. They do not simply add up."
  • how-it-saves.md:27: "Measured: ~1%". The PR body gives about $8 of saving, or ~0.5–1%. "~1%" is the top of that range. This is acceptable, but "0.5–1%" is more exact.

What I checked

  • Last review: round 1, 95622f3, 2026-11-06T11:46:38Z
  • New commits read: 1 — 36fbd30b docs: match how-it-saves.md to the new figure, review fixes
  • Read in full: 2 reviews, 1 comment, 0 inline comments (from the three files)
  • New items since my last review:
    • Reviewer 2 round-1 review (11:46:36Z, posted 2 s before mine): read in full. Its findings 1 and 2 are the same as my 1 and 2. I checked its non-blocking points above.
    • Author reply comment (11:48:44Z): read in full. I checked each reply against the commit (see "Earlier findings").
    • Commit 36fbd30b: read the full diff of how-it-saves.md, savings-figure.html, mkdocs.yml and render-savings-figure.sh, and the code around each change. I looked at both new PNGs: the chip says plugin default, with no clipped text or overlap.
  • No code, config or component change: the fail-open, data-dependence and behavior-change rules do not apply.
  • I did not run the render script or mkdocs build (no live tests approved).

@amiddavid

Copy link
Copy Markdown
Collaborator

compaction 5-10
tools / mop 2-5

on the two compactions make the pill more noticable ( blue or orange or gradient)
medium high => medium/high

one important comment find a way to make people understand that once u combine 4 boxes u get 15-30
perhaps a small line above the boxes
x+y+ z+ q ===

- Compaction 5-10%, tool search 2-5%.
- Gradient pills for the two compaction parts; medium/high in one pill.
- An equation line above the boxes: ~1% + 2-5% + 5-10% + 15-20% = 15-30%.
- how-it-saves.md and the README alt text match.

Assisted-By: Claude Opus 5.5
Signed-off-by: Osher Elhadad <[email protected]>
@OsherElhadad

Copy link
Copy Markdown
Collaborator Author

@amiddavid thanks. All done in c84526c:

  • Compaction: 5–10%.
  • Tool search (MCP/skills): 2–5%.
  • Compaction pills: both now use the blue-to-orange gradient, with white text.
  • medium · high → medium/high.
  • How the four add up: a new line above the boxes: ~1% + 2–5% + 5–10% + 15–20% = 15–30%. A short note under it says the savings overlap, so the total is less than the plain sum (23–36%).

The docs page (how-it-saves.md) and the README alt text use the same numbers.

Assisted-By: Claude Opus 5.5
Signed-off-by: Osher Elhadad <[email protected]>
@OsherElhadad
OsherElhadad merged commit 363f0f1 into main Nov 6, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 6, 2026
@OsherElhadad
OsherElhadad deleted the docs/readme-savings-figure branch November 6, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants