The page leanprompt report --html writes for webbrain-one/webbrain at commit c40d107, audited 2026-11-28. Every figure on this page is an estimate from reading the code, not a measurement of the app in use. Corrections and takedown: email info@podwarden.com or open an issue. Back to the audit of webbrain-one/webbrain

leanprompt audit of webbrain-one/webbrain

Unattended audit: nobody was asked during the run, so priority, volume and prices were left open; the questions for the owner are listed at the end.

2 places where this app pays for tokens it doesn't need

The biggest, at src/chrome/src/providers/anthropic.js:435, about 12M tokens per 1,000 calls: the Anthropic, Claude-subscription and Vertex AI paths build the /v1/messages body (and rawPredict body) with no cache_control field, anywhere in the extension.

Together about 12M tokens per 1,000 calls An estimate from the code, not a measurement. Findings that overlap are counted once.

Tokens per 1,000 calls, by finding, and each one's share of the total

Plus 1 other problem the audit found, listed after the findings. Not scored.

What this costs you

Every figure here is an estimate from the code, not a measurement. Findings the audit marked as overlapping are counted once in the totals, the largest of each group; other findings can still overlap. Money is not part of the score. The table lists this app's findings first, largest first, then its open questions, then the questions for the server's administrator, then the findings the project already knows about, which are not in the totals.

FindingWhereTokens per 1,000 calls
LP-PC-01src/chrome/src/providers/anthropic.js:43512M not cached; the fix writes 800k to the cache at the write price
LP-PC-01src/chrome/src/providers/aws-bedrock.js:1643M not cached; the fix writes 200k to the cache at the write price

To see this in money, add to leanprompt.yaml:

  • volume: {calls_per_month: N}: how many calls the app makes a month (with targets:, on each entry)
  • prices: per model: input, cached_input and output per 1M tokens (US dollars, or set currency), with source and checked date (or, self-hosted, engine: {prefill_tokens_per_second: N})

leanprompt never guesses a volume or a price. Your coding agent can look up the provider's current price page and add it with the date; how.

What's wrong and what to change

2 open, 0 fixed. Largest first, by the audit's estimate of tokens lost per 1,000 calls.

The Anthropic, Claude-subscription and Vertex AI paths build the /v1/messages body (and rawPredict body) with no cache_control field, anywhere in the extension.

Finding 1. src/chrome/src/providers/anthropic.js:435 high LP-PC-01

Anthropic only caches when a mark is sent, so the whole Act system prompt (about 48,800 characters in SYSTEM_PROMPT_ACT, roughly 12,000 tokens) plus the tool list and the growing history is read at full input price on every step of the agent loop. A comment at agent.js:38667 says the prompt is ordered so Anthropic hits the cache, but no mark is sent. The Firefox build has the same code (src/firefox/src/providers/anthropic.js:433).

What to change
Send a cache mark on the request: one top-level cache_control {"type":"ephemeral"} for automatic caching on api.anthropic.com, or an explicit cache_control on the last system block and the last tool for the Vertex path. The prompt is already stable first and volatile last, and runtime context is kept out of the system prompt (agent/runtime-context.js:90).
Why it matters
An agent run makes many calls within seconds of each other, so each new call can read the prompt prefix at the cache-read price instead of the full input price; the mark costs a one-time write premium per run.
Who reaches this
only users on the Anthropic, Claude-subscription or Vertex Claude providers
Overlaps
Finding 2 loses some of the same tokens; the totals count the larger once.
Estimate
about 12M prompt tokens per 1,000 Anthropic-path calls read at full price instead of cache price (estimate)
What the estimate assumes

system prompt about 12,000 tokens from 48,835 characters at 4 chars per token (estimate, not tokenizer-counted); average call about 20,000 prompt tokens; about 15 steps per run so about 67 cache writes per 1,000 calls; reaches only users on Anthropic, Claude-subscription or Vertex Claude; minimum cacheable length is 512 tokens on current models per the Anthropic page, well below the prompt size.

How to check the fix Run two steps of one task, then check usage.cache_creation_input_tokens is about the prompt size on step 1 and cache_read_input_tokens on step 2.

The Bedrock Converse payload has no cachePoint block, so Claude models on Bedrock also re-read the full system prompt and tools on every step.

Finding 2. src/chrome/src/providers/aws-bedrock.js:164 medium LP-PC-01

The cost meter already reads cacheReadInputTokens and cacheWriteInputTokens, but nothing ever writes a cache.

What to change
Add a {"cachePoint":{"type":"default"}} entry after the system text and after the tool list in _toBedrockPayload.
Why it matters
Same loop as f1; Bedrock charges the discounted cache-read rate only for tokens before a cache checkpoint.
Who reaches this
only users on AWS Bedrock Claude models
Overlaps
Finding 1 loses some of the same tokens; the totals count the larger once.
Estimate
about 3M prompt tokens per 1,000 Bedrock-path calls (estimate)
What the estimate assumes

same prompt size as f1; Bedrock users are a small share of calls; the model must support caching and the prefix meets its minimum (512 to 4,096 tokens per the Bedrock page).

How to check the fix Check cacheWriteInputTokens is non-zero on step 1 and cacheReadInputTokens on step 2.

Other problems the audit found

Problems the audit checked in the code that cost no tokens of their own, such as a spend meter that ignores cache tokens or a cut-off answer accepted as complete. They are not scored. Check each one before you change anything.

Helicone preset defaults to a model OpenAI retired in February 2026

Note 1. src/chrome/src/providers/provider-catalog.js:105 not scored

The Helicone catalogue entry uses chatgpt-4o-latest as its default model. The OpenAI deprecations page lists chatgpt-4o-latest as shut down on Feb 17, 2026 with gpt-5.1-chat-latest as replacement. If the gateway forwards the id unchanged, a new Helicone setup fails until the user picks another model. The same entry exists in src/firefox/src/providers/provider-catalog.js:105.

What to change
Change the default (and its price fields) to a current model id, for example gpt-5.1-chat-latest or another from the suggestions list.

How to check the fix Select Helicone in Settings, press Test connection with an empty model field and a valid key; the test should pass.

Fix it with your coding agent

Paste this into Claude Code, Codex, Cursor or any coding assistant. It will check each finding against your code and propose fixes one at a time, asking before it changes anything.

Please check and fix the LLM-call findings from a leanprompt audit of this repository.

1. If the leanprompt skills are not installed for you here, install them: npx leanprompt@0.1.0-dev.15 install
2. Read .leanprompt/findings.json and leanprompt-report.md. If they are missing, use the list below.
3. Check each finding against the code before you change anything. The audit can be wrong: if a finding does not hold, tell me why and leave that code alone.
4. Fix one finding at a time. Show me the change as a small diff and apply it only after I say yes.
5. Prove each fix with the measure-loop skill: a before and after on the same scenario. Ask me before running anything that sends real, billed requests.
6. When a fix is proved, set "fixed": true on its finding in .leanprompt/findings.json and run npx leanprompt@0.1.0-dev.15 score.

Findings, largest first:
1. LP-PC-01 at src/chrome/src/providers/anthropic.js:435: The Anthropic, Claude-subscription and Vertex AI paths build the /v1/messages body (and rawPredict body) with no cache_control field, anywhere in the extension. Anthropic only caches when a mark is sent, so the whole Act system prompt (about 48,800 characters in SYSTEM_PROMPT_ACT, roughly 12,000 tokens) plus the tool list and the growing history is read at full input price on every step of the agent loop. A comment at agent.js:38667 says the prompt is ordered so Anthropic hits the cache, but no mark is sent. The Firefox build has the same code (src/firefox/src/providers/anthropic.js:433).
2. LP-PC-01 at src/chrome/src/providers/aws-bedrock.js:164: The Bedrock Converse payload has no cachePoint block, so Claude models on Bedrock also re-read the full system prompt and tools on every step. The cost meter already reads cacheReadInputTokens and cacheWriteInputTokens, but nothing ever writes a cache.

Other problems found (check each against the code first; not scored):
- Helicone preset defaults to a model OpenAI retired in February 2026 (src/chrome/src/providers/provider-catalog.js:105): The Helicone catalogue entry uses chatgpt-4o-latest as its default model. The OpenAI deprecations page lists chatgpt-4o-latest as shut down on Feb 17, 2026 with gpt-5.1-chat-latest as replacement. If the gateway forwards the id unchanged, a new Helicone setup fails until the user picks another model. The same entry exists in src/firefox/src/providers/provider-catalog.js:105. Change: Change the default (and its price fields) to a current model id, for example gpt-5.1-chat-latest or another from the suggestions list.

Score

One number from 0 to 100 for how well this app avoids paying for the same tokens twice; higher is better. It is computed from the findings above (static) or from your usage log (measured).

70static
E, prefill reuse
0.50
S, prefix stability
1.00
G, generation waste
0.00
Default shares
0 of 2

Findings scored with severity defaults, not estimates. The fewer, the more the static score says about this app.

A static score is an estimate from the audit's findings, not a measurement.

Scored 2026-11-28 (the date on the machine that ran it).

Questions for the owner

These were not answered during the audit. Until they are, the page shows tokens only and ranks the advice without a priority.

  • Priority: which matters most for this app, cost, speed or quality (or weights)? Not set, so the advice uses equal weights. Answer with priority: in leanprompt.yaml.
  • Volume: how many calls does the app make a month? Answer with volume: {calls_per_month: N, source: "..."} in leanprompt.yaml.
  • Prices: what does each model cost (input, cached input, output per 1M tokens, with the source and the date it was read, and the currency if not US dollars)? Answer with prices: in leanprompt.yaml.