# leanprompt > Get more from every LLM call your app makes: skills that make prompts cacheable, cut dead weight, stop wasted output and speed up first tokens, without changing the answers, plus a CLI to measure the result. The full text of the main pages of https://lmwarden.com/leanprompt/ for language models. The short index is https://lmwarden.com/leanprompt/llms.txt. Source: https://github.com/Podwarden/leanprompt # leanprompt **Get more from every LLM call your app makes.** Skills for your coding agent, by the LM Warden Team, that find where an LLM-powered app pays for tokens it does not need, then fix it with a diff you approve. [![license: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE) [![ci](https://github.com/Podwarden/leanprompt/actions/workflows/ci.yml/badge.svg)](https://github.com/Podwarden/leanprompt/actions/workflows/ci.yml) [![npm](https://img.shields.io/npm/v/leanprompt)](https://www.npmjs.com/package/leanprompt) | Without leanprompt | With leanprompt | |---|---| | The leanprompt audit page for the dated-chat example before the fix: one finding at app.ts line 11, where the system prompt starts with the current time; an estimate of 6.7 million tokens per 1,000 calls that the cache could have served; static score 46 | The leanprompt audit page for the same example after the fix: no open findings, 1 finding fixed, static score 100 | **[See what it found in 36 public apps](https://lmwarden.com/leanprompt/audits/)**: 225 problems, each with the commit it ran on and a diagram of the mistake (page checked 2026-11-30). From your project root, then reload your coding agent and type `/leanprompt audit`: ``` npx leanprompt install ``` leanprompt is pre-release. It needs Node 20.19 or newer, shows every file it will write and asks before writing. Works with Claude Code, Codex, Cursor, OpenCode and any agent that reads `AGENTS.md` (`$leanprompt audit` in Codex). Other routes, including the Claude Code plugin: [docs/install.md](docs/install.md). Your app calls an LLM on every request, and the bill grows with traffic. Somewhere a timestamp sits on the first line of the system prompt, so the provider cache never reuses what follows it. Or a cut-off answer is sent again unchanged, or the whole history is resent on every turn. Nothing errors, so nobody notices until the invoice. leanprompt reads your code, lists every LLM call, ranks where it loses tokens and time, and shows the diff for each fix. It works on the app your assistant is building, not on the assistant's own bill, and it is not a prompt-compression library. Built by the LM Warden Team. The example above is [`examples/dated-chat`](examples/dated-chat/README.md), audited before and after one fix: the time moves from the top of the prompt to the newest message. Both pages show estimates from the code, not measurements; `/leanprompt measure` turns a fix into a before and after number. ## What we found in 36 public apps We run leanprompt on popular public repositories and publish what it finds at **[lmwarden.com/leanprompt/audits](https://lmwarden.com/leanprompt/audits/)**. As of 2026-11-30 the page lists 36 audited apps and 225 problems: prompts the cache can never reuse, cut-off answers sent again, whole histories resent each turn, and a default model the provider has already shut down. The figures are estimates from reading the code, not measurements. We tell the maintainers first, and maintainers have already fixed findings upstream in several, for example: - [HKUDS/LightRAG](https://lmwarden.com/leanprompt/audits/hkuds__lightrag/): merged all three of our pull requests on 2026-11-30 (Bedrock cache marks and metering, a retired-model warning, cached-token metering for the OpenAI Responses binding). - [Abrechen2/sublarr](https://lmwarden.com/leanprompt/audits/abrechen2__sublarr/): fixed three reported points in release 1.22.0. - [yihong0618/bilingual_book_maker](https://lmwarden.com/leanprompt/audits/yihong0618__bilingual_book_maker/): the retry of a cut-off batch was fixed in pull request #590, merged 2026-11-27. ## Commands Type `/leanprompt` alone to see them in your assistant. `npx leanprompt --help` lists the terminal commands. | | Commands | |---|---| | **Set up** | `npx leanprompt install` installs the skills · `npx leanprompt update` refreshes them · `/leanprompt init` writes `leanprompt.yaml`: your targets, priority, volume and prices | | **Audit** | `/leanprompt audit` finds every LLM call and ranks where it loses tokens and time · `/leanprompt score` scores the app, measured or static | | **Fix and prove** | `/leanprompt fix` checks each finding, shows a diff, applies it on your yes · `/leanprompt measure` proves it with a before and after | | **Share** | `/leanprompt report` writes a local page in plain English · `/leanprompt lesson` drafts a lesson-learned issue, sending nothing · `npx leanprompt score --github` annotates a pull request ([docs/ci.md](docs/ci.md)) | The usage logger that `measure` adds to your app installs with `npm i leanprompt`, or for Python `pip install --pre leanprompt-cli` (`--pre` because it is a pre-release); your assistant asks first. No telemetry, no proxy, no hosted service, no account. It does not edit your code without asking. ## Why Every call to an LLM resends the system prompt, the tool list and the history. Providers cache the part that did not change, but only if it really did not change, byte for byte, from the first token. Most apps break that without knowing: a timestamp on the first line, tools built from an unsorted dict, a client that never sends Anthropic's cache marks. Then they pay again for output: a retry after a truncation, one request per sample, a parse failure re-asked from scratch. | What changed | Before | After | |---|---|---| | Replayed coding-agent sessions on Anthropic: did the client send cache marks? No marks: Codex and OpenCode sessions; 3 marks: a Claude Code session | no marks: 0 tokens from cache on 29 turns (E1) | 3 marks: 92% of prompt tokens from cache on one session (435,661 of 471,607) (E1) | | Thinking toggled between turns vs kept the same, one session on a self-hosted vLLM (Qwen hybrid model) | toggled turns lost 47% of what they could have reused (E7) | turns with the same setting as the turn before lost nothing beyond the engine rule (E7) | | Cache-aware replica routing (LM Warden, an engine setting, not a prompt rule); synthetic load, 8 concurrent agent sessions, one run per arm; at 24+ sessions (overload) the median got worse | median time to first byte 2.33 s; 44% of prompt tokens from cache (E10) | median time to first byte 0.48 s; 86% from cache; output tokens a minute +29% (E10) | And one that went the other way: moving the date to the end of the prompt cut correct date answers from 10/12 to 1/12 and did not help the cache (E6). leanprompt's rules keep meaning first. Every figure above is a row in [docs/evidence.md](docs/evidence.md), with its source and its limits. ## What's in the box Seven skills, each a folder with a `SKILL.md`; the rule skills have one file per rule. - [`leanprompt`](skills/leanprompt/SKILL.md): the entry point; routes each command to the skill below that does the work. - [`llm-call-audit`](skills/llm-call-audit/SKILL.md): finds every LLM call, checks it against the rules, ranks the findings and writes the report. - [`prefill-cache`](skills/prefill-cache/SKILL.md): prompts the provider's prefix cache can reuse (LP-PC-01 to LP-PC-12). - [`generation-economy`](skills/generation-economy/SKILL.md): samples, budgets, timeouts, retries and batching that do not waste calls or output (LP-GE-01 to LP-GE-10), and a correctness rule for apps that meter their own spend (LP-GE-11). - [`prompt-diet`](skills/prompt-diet/SKILL.md): dead weight in what each call sends, every trim with an answer check (LP-PD-01 to LP-PD-06). - [`measure-loop`](skills/measure-loop/SKILL.md): measure, change one thing, measure again; the usage logger, the stable-head CI test, the score. - [`lmwarden`](skills/lmwarden/SKILL.md): self-hosted engines (vLLM, SGLang, LM Warden): engine settings, replica routing, cache isolation (LP-LW-01 to LP-LW-03). ## Learn more - [Install and update](docs/install.md): every assistant, project or global, the Claude Code plugin, Windows. - [How it works](docs/how-it-works.md): the audit, the rules at a glance, and how to prove a fix. - [The score and the badge](docs/score.md), [calibration](docs/calibration.md) and [leanprompt in CI](docs/ci.md). - [Provider notes](docs/providers.md) and [self-hosting](docs/self-hosting.md), including LM Warden and its limits. - [All docs](docs/README.md), including the [evidence table](docs/evidence.md) and the [changelog](docs/CHANGELOG.md). ## Contributing Issues and pull requests are welcome. A new rule needs a "Verify" section and either a measured example or a dated provider-doc source; commits carry a DCO sign-off. See [CONTRIBUTING.md](.github/CONTRIBUTING.md), [GOVERNANCE.md](.github/GOVERNANCE.md) and [SECURITY.md](.github/SECURITY.md). If leanprompt helped you, or a rule misled you, share a lesson in general terms with the [Lesson learned form](https://github.com/Podwarden/leanprompt/issues/new?template=lesson-learned.yml); credit is optional ([THANKYOU.md](docs/THANKYOU.md)). ## License Code (`cli/`, `eval/`, `examples/`, `python/`, `scripts/`) is under [Apache-2.0](LICENSE). The skills, provider and model tables, docs and this README are under [CC BY 4.0](LICENSE-DOCS). Copyright the LM Warden Team. "PodWarden" and "LM Warden" are trademarks of their owners; see [NOTICE](NOTICE). ## Related projects - [kvsig](https://github.com/Podwarden/kvsig): the open spec for keyed conversation and prefix ids that the stable-head test and the measured score use. - [LM Warden](https://github.com/Podwarden/lm-warden): self-hosted, cache-aware model serving on your own NVIDIA GPUs. # How leanprompt works leanprompt is a set of skills for coding assistants. It finds the places where an app's LLM calls lose tokens or time (a prompt the cache cannot reuse, dead weight in the prompt, output thrown away), proposes a fix for each that keeps meaning, and proves the fix with the provider's own usage numbers. This page covers the problem, the audit, the rules and the measure loop. Back to the [README](../README.md). ## The problem Every call to an LLM resends the system prompt, the tool list and the history. Providers and engines cache the part that did not change, but only if it really did not change, byte for byte, from the first token. Most apps break that without knowing: a timestamp on the first line, tools built from an unsorted dict, a history store that re-serialises old messages, a client that never sends Anthropic's cache marks. Then they pay again to generate what one call could have produced: a retry after a truncation, one request per sample, a parse failure re-asked from scratch. leanprompt gives your coding assistant the rules to find those places in your code, the fix for each, and a way to prove the fix helped with the provider's own usage fields. ## How the audit works Ask your assistant to *audit this app's LLM calls*. The [`llm-call-audit`](../skills/llm-call-audit/SKILL.md) skill: 1. Inventories the call sites by SDK and HTTP shape (Anthropic, OpenAI, Gemini, LangChain, LlamaIndex, LiteLLM, the Vercel AI SDK, raw `fetch` or `requests`), and follows each one back to where its system prompt, tools and history are built. 2. Checks each call against the rules and records every finding with its rule id, file and line. A finding outside the repository (an engine's launch flags, say) is recorded as `` with where it lives, and one that depends on a fact the code cannot show carries the question that would settle it; both count in the static score and are listed as open questions. A finding whose fix is a setting of the server or engine the app calls is listed separately, as a question for the server's administrator, and is not in the app's score ([score.md](score.md#the-apps-score-and-the-servers-questions)). A verified problem the rules have no place for (a spend meter that ignores cache tokens, a cut-off answer accepted as complete) is recorded as a note: shown and handed off, never scored. A rule that depends on a provider feature (a cache mark, a batch API) applies only to the providers it lists. A rule whose fix is the same everywhere (output limits, retries, timeouts, structured output, response caching) applies to every target, including a hosted API that has no provider table here. 3. Proposes one fix per finding, with the rule's "Don't break meaning" check, and asks before editing anything. A fix that cuts dead weight from the prompt ([`prompt-diet`](../skills/prompt-diet/SKILL.md)) ships only after an answer check, and a cut to the cached head of the prompt is weighed against the cache it breaks. 4. Hands each fix to [`measure-loop`](../skills/measure-loop/SKILL.md) to prove it with a before and after number. The audit writes `.leanprompt/findings.json`, and `leanprompt report --md` writes `leanprompt-report.md` from it, so the report and the page say the same thing. The report follows [report-template.md](../skills/llm-call-audit/report-template.md): a plain-English headline, what the findings cost, each finding's problem, change and reason, a hand-off block for a coding agent, the score, the call inventory and the next steps. `leanprompt report --html` turns the same content into a single local page (`.leanprompt/report.html`) with copy buttons, for the person who reads the audit. If you tell the audit you are on a particular provider or self-hosted engine, or that speed matters more than cost, put it in [`leanprompt.yaml`](profile.md) and the findings are ranked for that target. ## The rules at a glance Prefill rules first, then generation, then dead weight in the prompt, then self-hosted. Every rule file ends with a "Verify" section: the usage field that must change and the kvsig id that must stay equal. | Rule | In one line | Saves | |---|---|---| | [LP-PC-01](../skills/prefill-cache/rules/LP-PC-01.md) | Put cache marks where the provider needs them | prefill | | [LP-PC-02](../skills/prefill-cache/rules/LP-PC-02.md) | Stable content first, without hurting meaning | prefill | | [LP-PC-03](../skills/prefill-cache/rules/LP-PC-03.md) | No ids, timestamps, versions or paths at the top of the prompt | prefill | | [LP-PC-04](../skills/prefill-cache/rules/LP-PC-04.md) | Fixed tool order and JSON key order | prefill | | [LP-PC-05](../skills/prefill-cache/rules/LP-PC-05.md) | Tool lists grow only at the end | prefill | | [LP-PC-06](../skills/prefill-cache/rules/LP-PC-06.md) | Append-only history | prefill | | [LP-PC-07](../skills/prefill-cache/rules/LP-PC-07.md) | Shared context before per-user context | prefill | | [LP-PC-08](../skills/prefill-cache/rules/LP-PC-08.md) | Cache-aware compaction | prefill | | [LP-PC-09](../skills/prefill-cache/rules/LP-PC-09.md) | Consistent reasoning handling; thinking fixed per session | both | | [LP-PC-10](../skills/prefill-cache/rules/LP-PC-10.md) | Stable image and attachment placement | prefill | | [LP-PC-11](../skills/prefill-cache/rules/LP-PC-11.md) | Keep pauses inside the cache lifetime | prefill | | [LP-PC-12](../skills/prefill-cache/rules/LP-PC-12.md) | Do not split one prefix across models or keys that do not share a cache | prefill | | [LP-GE-01](../skills/generation-economy/rules/LP-GE-01.md) | n samples in one request | prefill | | [LP-GE-02](../skills/generation-economy/rules/LP-GE-02.md) | Batch independent questions about one context | both | | [LP-GE-03](../skills/generation-economy/rules/LP-GE-03.md) | Output and thinking budgets that fit the task | generation | | [LP-GE-04](../skills/generation-economy/rules/LP-GE-04.md) | Stream long outputs; timeouts that match generation time | both | | [LP-GE-05](../skills/generation-economy/rules/LP-GE-05.md) | Retry only retryable errors; never retry a truncation unchanged | both | | [LP-GE-06](../skills/generation-economy/rules/LP-GE-06.md) | Cache exact responses for deterministic requests | both | | [LP-GE-07](../skills/generation-economy/rules/LP-GE-07.md) | Batch API for work that can wait | both | | [LP-GE-08](../skills/generation-economy/rules/LP-GE-08.md) | Route trivially small calls to a small model | both | | [LP-GE-09](../skills/generation-economy/rules/LP-GE-09.md) | Predicted outputs for mostly unchanged text | generation | | [LP-GE-10](../skills/generation-economy/rules/LP-GE-10.md) | Structured output instead of parse-and-re-ask | generation | | [LP-GE-11](../skills/generation-economy/rules/LP-GE-11.md) | Meter every billed token, cached and unfinished ones too | none: a correctness rule, recorded as a note | | [LP-PD-01](../skills/prompt-diet/rules/LP-PD-01.md) | Offer each route only the tools it can use | prefill | | [LP-PD-02](../skills/prompt-diet/rules/LP-PD-02.md) | Say each instruction once | prefill | | [LP-PD-03](../skills/prompt-diet/rules/LP-PD-03.md) | Do not resend the same boilerplate on every turn | prefill | | [LP-PD-04](../skills/prompt-diet/rules/LP-PD-04.md) | Trim tool results and retrieved context at the tool boundary | prefill | | [LP-PD-05](../skills/prompt-diet/rules/LP-PD-05.md) | Drop stale history on purpose, not by stripping | prefill | | [LP-PD-06](../skills/prompt-diet/rules/LP-PD-06.md) | Compact serialisation for data in the prompt | prefill | | [LP-LW-01](../skills/lmwarden/rules/LP-LW-01.md) | Turn on prefix caching and set the match unit | prefill | | [LP-LW-02](../skills/lmwarden/rules/LP-LW-02.md) | Keep a conversation on the replica that holds its cache | prefill | | [LP-LW-03](../skills/lmwarden/rules/LP-LW-03.md) | One key per app or tenant; cache scope is a privacy boundary | prefill | ## Prove it: measure, change, measure Start with what the provider already tells you. OpenAI-compatible APIs, vLLM, DeepInfra and OpenRouter report `usage.prompt_tokens_details.cached_tokens`; Anthropic reports `usage.cache_read_input_tokens` and `usage.cache_creation_input_tokens`. Compare them across two requests of the same conversation, before and after a fix. To keep a fix from coming undone, add a stable-head test. It builds the request your app would send for two fixed inputs and fails when the system prompt or tool list differs, using [kvsig](https://github.com/Podwarden/kvsig) ids. It runs offline, with no provider call: ```ts import { assertStableHead } from "./stable-head"; it("the head does not change from one day to the next", () => assertStableHead( (now) => app.buildRequest("Where is my order?", { session: 0, turn: 0, now }), [new Date("2026-11-03T08:15:42Z"), new Date("2026-11-04T17:02:09Z")], { sys: true, tools: true }, )); ``` When `sys` differs, something in the system prompt changes per input (a date, an id, a path); when `tools` differs, a tool was reordered or edited. The helper templates (TypeScript and Python) to copy into your tests and the table of which id to assert for each rule are in [measure-loop](../skills/measure-loop/SKILL.md#the-stable-head-test-kvsig-ids-in-ci). For a measured score, log every call with the usage logger: `leanprompt/log` for TypeScript and `leanprompt-cli` for Python, both published with the first release. It writes one JSON line per call to `.leanprompt/usage.jsonl` with keyed ids, token counts and flags, and never writes prompt or completion text. How the log becomes a score: [score.md](score.md). ## Evidence and example apps The figures in the README, these docs and the skills come from the table in [evidence.md](evidence.md) (rows E1 to E12, each with its source, date and limits) or from measured result files under `eval/results/`, which stays empty until the first real replay is committed. Results from the cache simulator run in CI only and are never quoted. `npm run check:numbers` fails the build when a number in the README, a page under `docs/` or a skill has no source. The example apps in [examples/](../examples/) each come in a `before/` and an `after/` form with an answer check, and `npm run eval` replays them: against the local simulator at no cost, or against a provider you name, which sends real, billed requests under a spend cap. ## What leanprompt is not - Not a proxy and not a prompt rewriter on the wire. It changes your code, with your approval, one fix at a time. - Not a prompt-compression library. Compressing a prompt changes its bytes on every call, which is what breaks a prefix cache. - Not a hosted service. There is no telemetry, no account and no upload. The CLI makes no network calls except `profile detect` (to the URL you give it) and the replay harness (to providers you name). - Not a promise of a percentage for your app. Measure it: the score says what it was computed from. # Install and update leanprompt Back to the [README](../README.md). leanprompt is pre-release, published on npm as `leanprompt` and on PyPI as `leanprompt-cli`. It needs Node 20.19 or newer. ## Install From your project root: ``` npx leanprompt install ``` To pin a release, add its version: `npx leanprompt@0.1.0-dev.15 install`. To run the latest code from GitHub instead: `npx github:Podwarden/leanprompt install`. In a terminal, `install`: 1. finds the coding assistants the project uses, from `.claude/`, `AGENTS.md`, `.codex/`, `.opencode/` and `.cursor/` (for all your projects, from `~/.claude`, `~/.codex`, `~/.config/opencode` and `~/.cursor`); 2. asks: install for this project or for all your projects? 3. lists every file it will write, update or skip, and asks before writing; 4. ends with what to type next in each assistant, for example `Next: open Claude Code here and type /leanprompt audit`. The installed skills carry what an audit needs offline: the provider, model and runtime fact tables, the evidence table and the profile reference, under `leanprompt/facts/` next to the other skills, linked from the rules. Their commands name the version that installed them (`npx leanprompt@ score`), so the skills and the CLI they call stay in step; `update` moves both to a new version. Auditing a repository that is not yours? Install with `--scope=global` so nothing is written into it, and see "Auditing someone else's repository" in the audit skill's `presenting.md`. Behind a private npm registry? A project whose `.npmrc` sets `registry=` to a private feed (an Azure Artifacts or Artifactory mirror, for example) can answer `npx leanprompt` with a 404 when the feed does not carry the package. Point that one call at the public registry, without changing the project's settings: ``` npm_config_registry=https://registry.npmjs.org/ npx leanprompt install ``` On Windows PowerShell: `$env:npm_config_registry="https://registry.npmjs.org/"; npx leanprompt install`. The same variable works for every `npx leanprompt` command, including the ones the installed skills run. Reload your assistant afterwards so it sees the new skills. Then type `/leanprompt init` (`$leanprompt init` in Codex) to set up `leanprompt.yaml`, or `/leanprompt audit` to go straight to the audit. What it never does: overwrite a file it did not write (every file it writes carries a `leanprompt:generated` stamp, and in `AGENTS.md` it only touches the text between its own markers), write through a symlinked folder that leads outside the project, or make a network call. A second run changes nothing. ## Project or global | Assistant | This project | All your projects (`--scope=global`) | Type next | |---|---|---|---| | Claude Code | `.claude/skills//` | `~/.claude/skills//` | `/leanprompt audit` | | Codex | `.agents/skills//` and a block in `AGENTS.md` | `~/.agents/skills//` and a block in `~/.codex/AGENTS.md` | `$leanprompt audit`, or pick it from `/skills` | | Cursor | `.cursor/skills//` | `~/.cursor/skills//` | `/leanprompt audit` in the Agent chat | | OpenCode | `.opencode/commands/leanprompt.md` (and `leanprompt-audit.md`) and a block in `AGENTS.md` | `~/.config/opencode/commands/` and `~/.config/opencode/AGENTS.md` | `/leanprompt audit` | | Any `AGENTS.md` agent | `.agents/skills//` and a block in `AGENTS.md` | none: the convention has no user-level location, so the installer says so and skips it | ask it to use the leanprompt skill | Every location comes from the assistant's own documentation, checked on 2026-11-26; the sources are in [assistant-paths.md](assistant-paths.md). Cursor and OpenCode also read `.claude/skills` and `.agents/skills` (and the same folders in your home), so when one of those already holds the skills, they get no second copy. When Claude Code and an `AGENTS.md` are both found, the skills go in `.claude/skills` once and the `AGENTS.md` block points at them. ## For scripts and CI ``` npx leanprompt install --providers=claude,cursor --scope=project --yes ``` - `--providers=`: install for these instead of detecting; any of `claude`, `codex`, `opencode`, `cursor`, `agents-md`. - `--scope=project|global`: this project, or all your projects. Without it, a terminal run asks and any other run uses `project`. - `--yes`: write without asking. Without a terminal and without `--yes`, `install` prints the plan and exits 1 without writing anything. - `--dry-run`: list what would be written or skipped, write nothing, exit 0. - `--dir `: another project folder. `init` is the same command under its older name, so older links keep working. `--assistant ` (one assistant) and `--global` still work too. ## Update ``` npx leanprompt update ``` `update` looks in this project and in your home folder for what an earlier install wrote, refreshes those files to this version, adds files that are new in it, and lists what changed. It never touches a file without leanprompt's stamp. `--scope=project` or `--scope=global` limits where it looks, and `--dry-run` lists without writing. Reload your assistant afterwards. Installs from before 0.1.0-dev.8 gave Cursor one rule file per skill (`.cursor/rules/leanprompt-*.mdc`). Cursor now reads the skills, so `update` lists those files and leaves them alone; delete them when you like. ## The Claude Code plugin Instead of the CLI, Claude Code can install the skills as a plugin, inside a session: ``` /plugin marketplace add Podwarden/leanprompt /plugin install leanprompt@leanprompt ``` Plugin skills carry the plugin's name, so the command is `/leanprompt:leanprompt`; bare `/leanprompt` runs it too unless another command already uses that name ([code.claude.com/docs/en/skills](https://code.claude.com/docs/en/skills)). The plugin installs the skills only; the score, the report page and the other terminal commands still run through `npx`. ## The usage loggers The measure loop logs every call with a small logger inside the app. Your assistant proposes the command and asks before it runs. - TypeScript or JavaScript, which gives `import { createLogger } from "leanprompt/log"` with its types: ``` npm i leanprompt ``` It needs Node 20.19 or newer. - Python, which gives `from leanprompt_cli import Logger`: ``` pip install --pre leanprompt-cli ``` `--pre` is needed because `leanprompt-cli` is a pre-release; `pip install leanprompt-cli==0.1.0.dev11` works too, and `uv pip install` takes the same arguments. Use of the loggers: [measure-loop](../skills/measure-loop/SKILL.md#log-every-call). ## Or clone and build If you would rather build the CLI yourself, or want the latest code, build it once from a clone: ``` git clone https://github.com/Podwarden/leanprompt cd leanprompt npm ci && npm run build && npm link ``` `npm link` puts a `leanprompt` command on your `PATH` that runs from the clone; `git pull && npm run build` updates it, and `npm unlink -g leanprompt` removes it. Without `npm link`, run it directly: `node /path/to/leanprompt/cli/dist/main.js install --dir /path/to/your-app`. ## Windows `npx leanprompt install` works the same in PowerShell or `cmd`, and so do the clone-and-build steps (CI builds and tests leanprompt on Windows). The `curl | sh` line below is for macOS and Linux only. ## Without typing npx (macOS and Linux) [scripts/install.sh](../scripts/install.sh) runs the same `install` through `npx leanprompt@` (the release's version, or the latest published version when none is set), so it still needs Node. In a terminal it hands the installer the terminal, so the questions still work when piped. Arguments pass through: ``` curl -fsSL https://raw.githubusercontent.com/Podwarden/leanprompt/main/scripts/install.sh | sh -s -- --providers=cursor ``` To pin a release, set the version for `sh`: ``` curl -fsSL https://raw.githubusercontent.com/Podwarden/leanprompt/main/scripts/install.sh | LEANPROMPT_VERSION=0.1.0-dev.15 sh -s -- --providers=cursor ``` # The score and the badge `leanprompt score` turns either your usage log or the audit's findings into one number from 0 to 100, and writes it with its inputs to `.leanprompt/score.json`. Back to the [README](../README.md). ``` leanprompt score ``` ## The formula The number is `floor(100 × (0.6 × E × S + 0.4 × (1 − G)))`, shown with its inputs: - **E**, prefill reuse: cached prompt tokens over reusable prompt tokens, where reusable is capped by the provider's own rules (minimum size, block or step size, breakpoints, cache lifetime). - **S**, prefix stability: reusable over prompt tokens on requests that continue an earlier one. - **G**, generation waste: output tokens spent on repeated calls, retried truncations and parse failures, over all output tokens. A change to the formula or its weights, or to which findings it counts, is a minor version and is listed in the [changelog](CHANGELOG.md). Before 1.0, a development release (`0.1.0-dev.N`) may change it too, and its changelog entry says so under "Score change". ## Measured and static There are two kinds, always labelled. - A **measured** score comes from the usage log (`score --measured`). It needs at least 50 measured calls and states how many it used; with fewer, it refuses and suggests `--static`. The usage logger is described in [how-it-works.md](how-it-works.md#prove-it-measure-change-measure). - A **static** score comes from the audit's findings (`score --static`) and is an estimate, with a lighter badge colour. It is the app's own score: every finding about the app's code counts, including those recorded as `"file": ""` (outside the repository), `"status": "needs-facts"` (behaviour not confirmed), `"status": "frequency-unknown"` (the code shows it, only how often is assumed) or `"status": "size-unknown"` (the code shows it and how often, only the tokens each time are assumed). Findings for the server's administrator do not count by default, and neither do findings the project already knows about (below). ## The app's score and the server's questions Some findings are about the server or engine the app calls, not about the app's code: an engine's cache block size or match unit, its replicas, its keys, the chat template it serves. Their fix is a server setting that the app's developer may not control, and counting them made an app that is careful with its own calls look worse than its code. A finding is for the server's administrator when it has `"fix_by": "server"`; an `LP-LW-*` finding recorded in `""` gets that by default (write `"fix_by": "app"` to count it as the app's). The static score leaves these findings out: the formula is the same, over the app's findings only. `score.json` records how many there were (`diagnostics.server_findings`) and the score with them counted (`server.with_server_score` and `server.with_server_inputs`), and `score --static --with-server` makes that the headline score instead (its message says `with server`). The report page and `leanprompt-report.md` list these findings in their own section, "Questions for the server's administrator", each with what would answer it; for an LM Warden server, `leanprompt profile detect --lmwarden ` reads the engine's cache facts. The measured score is unchanged: it already treats the engine's block rounding as the engine's rule, not the app's. **This is a score change, in 0.1.0-dev.13.** A static score from a findings file with server findings can be higher than the same file scored by 0.1.0-dev.12, and `score --with-server` gives the old figure. Files with no server findings score the same as before. See the [changelog](CHANGELOG.md). ## What the project already knows, and overlapping findings Two kinds of finding change how the static score counts, from 0.1.0-dev.14. - **Already known to the project.** Before it writes the findings, the audit searches the project's issues, pull requests and docs for each one, and records a match in `known` with its link and kind: `planned`, `in-progress`, `reported` or `declined` (the older `planned` text field counts as `planned`). Such a finding is not new waste the audit found: the project has it in hand, or has decided against it. It is left out of the static score, out of the headline count and out of the totals. `score.json` records how many there were (`diagnostics.known_findings`) and the score with them counted (`known.with_known_score`, `known.with_known_inputs`). The page lists them under "Already known to the project", with planned, in-progress and reported work linked, and declined findings as one line each with the link and no proposed change. - **Overlapping findings.** When one fix covers two findings, or fixing one shrinks the other, the audit links them with `overlaps` (by finding `id`). Each group of overlapping findings counts once: on each side, the largest share in the group enters the formula, and the page's totals take the largest token figure in the group. Findings without `overlaps` add up as before. **This is a score change, in 0.1.0-dev.14.** A findings file with known or planned findings can score higher than it did in 0.1.0-dev.13 (`known.with_known_score` in `score.json` is the old figure); one with `overlaps` can score higher than the same findings without them. A file with neither scores the same as before. Each finding in a static score weighs its `share`: the fraction of prompt tokens (prefill) or output tokens (generation) it wastes. The audit derives it from its estimate of the tokens the finding loses per 1,000 calls, divided by that side's tokens for the same calls, and writes the assumptions in the report. A finding that saves both prefill and output can give the two sides separately, `share_prefill` and `share_output`, when they differ (a truncation retried unchanged loses mostly output, because the resent prompt is read from the cache); `share` alone applies to both sides. `share: 0` is allowed, for a finding that costs no tokens; the page lists such a finding but does not count it as a place that wastes tokens. A correctness rule (`saves: none`: LP-GE-11, a spend meter that undercounts, and LP-GE-12, 13, 15, 16 and 17) is recorded as a note and never enters the score. A finding with no share at all uses its severity's default share (high 0.5, medium 0.2, low 0.05). `score --static` prints how many findings did, as `default_shares: N of M`, and stores the same counts in `score.json` under `diagnostics` (`{"default_shares": N, "findings": M}`); `report --html` shows them next to the score. The more defaults, the less the static score says about your app. With no flag, `score` uses `.leanprompt/usage.jsonl` when it exists and `.leanprompt/findings.json` otherwise. ## Per run, counted, and private (0.1.0-dev.15) - **Per run.** A finding in a CLI or batch tool can give its figure per run (`"unit": "run"`, with `tokens_per_run` and a top-level `run` saying what one run is) instead of per 1,000 calls. Its `share` is still a share of the app's tokens, so the score is the same whichever unit the figure uses. The page and the Markdown report keep one total per unit and never add them. - **Counted.** A figure counted from the app's own committed output (`"evidence": "counted"`, with `counted_from`) is labelled "counted" instead of "estimate". It is scored like any other. - **Private.** A finding or note marked `"private": true` (security, privacy, legal) is left out of the score and of every public output, and listed only in `.leanprompt/private.md`. `score.json` does not mention it. - **Correctness rules.** LP-GE-12, LP-GE-13, LP-GE-15, LP-GE-16 and LP-GE-17 are correctness rules like LP-GE-11: recorded as notes, never scored. LP-GE-14 (a cache or change key that never hits) is a waste rule and is scored. No score change: a findings file valid in 0.1.0-dev.14 scores the same. ## Calibrate the static score `leanprompt calibrate` fits the static weights to your app from a trial run, so the static score tracks what a measurement would say. How to make the trial run: [calibration.md](calibration.md). ## The badge Commit `.leanprompt/score.json` and point shields.io's endpoint badge at its raw URL: ```markdown ![leanprompt](https://img.shields.io/endpoint?url=) ``` The report page (`leanprompt report --html`) fills the URL in for you when it can: it reads `git remote get-url origin` and the current branch (local git calls only, nothing goes over the network), and builds the raw URL for GitHub, GitLab.com and Bitbucket remotes. For any other host, or a repository with no remote, it says that the badge needs a public repository with `score.json` committed and shows no snippet, because shields.io could not read the file. When `score.json` is not tracked by git yet, it says to commit it first. The page offers the badge, a star and a message for a colleague only after it has shown something concrete: an estimate on a finding, or a measured score. Why the badge is honest: it reads your own committed file, not a number we host. The file carries the score, its kind, its inputs, the number of calls, the date (the local date on the machine that ran it) and the leanprompt version. A static score is labelled `static` and is always grey, because it is an estimate from the audit's findings, not a measurement; only a measured score gets a colour. There is no hosted service and no upload. Anyone can rerun `leanprompt score` on the repository: the file is the evidence. ## Rules - LP-PC-01: Put cache marks where the provider needs them (prefill-cache; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-pc-01/ - LP-PC-02: Stable content first, without hurting meaning (prefill-cache; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-pc-02/ - LP-PC-03: No ids, timestamps, versions or paths at the top of the prompt (prefill-cache; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-pc-03/ - LP-PC-04: Fixed tool order and JSON key order (prefill-cache; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-pc-04/ - LP-PC-05: Tool lists grow only at the end (prefill-cache; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pc-05/ - LP-PC-06: Append-only history (prefill-cache; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-pc-06/ - LP-PC-07: Shared context before per-user context (prefill-cache; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pc-07/ - LP-PC-08: Cache-aware compaction (prefill-cache; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pc-08/ - LP-PC-09: Consistent reasoning handling; thinking fixed per session (prefill-cache; saves both; severity high) https://lmwarden.com/leanprompt/rules/lp-pc-09/ - LP-PC-10: Stable image and attachment placement (prefill-cache; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pc-10/ - LP-PC-11: Keep pauses inside the cache lifetime (prefill-cache; saves prefill; severity low) https://lmwarden.com/leanprompt/rules/lp-pc-11/ - LP-PC-12: Do not split one prefix across models or keys that do not share a cache (prefill-cache; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pc-12/ - LP-GE-01: n samples in one request (generation-economy; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-01/ - LP-GE-02: Batch independent questions about one context (generation-economy; saves both; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-02/ - LP-GE-03: Output and thinking budgets that fit the task (generation-economy; saves generation; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-03/ - LP-GE-04: Stream long outputs; timeouts that match generation time (generation-economy; saves both; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-04/ - LP-GE-05: Retry only retryable errors; never retry a truncation unchanged (generation-economy; saves both; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-05/ - LP-GE-06: Cache exact responses for deterministic requests (generation-economy; saves both; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-06/ - LP-GE-07: Batch API for work that can wait (generation-economy; saves both; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-07/ - LP-GE-08: Route trivially small calls to a small model (generation-economy; saves both; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-08/ - LP-GE-09: Predicted outputs for mostly unchanged text (generation-economy; saves generation; severity low) https://lmwarden.com/leanprompt/rules/lp-ge-09/ - LP-GE-10: Structured output instead of parse-and-re-ask (generation-economy; saves generation; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-10/ - LP-GE-11: Meter every billed token, cached and unfinished ones too (generation-economy; saves none; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-11/ - LP-GE-12: Read the finish reason before using an answer (generation-economy; saves none; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-12/ - LP-GE-13: Default to a model the provider still serves (generation-economy; saves none; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-13/ - LP-GE-14: Build both sides of a cache or change key the same way (generation-economy; saves both; severity high) https://lmwarden.com/leanprompt/rules/lp-ge-14/ - LP-GE-15: Give each timeout one meaning, and set one (generation-economy; saves none; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-15/ - LP-GE-16: Fall back to another model only on errors it can fix (generation-economy; saves none; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-16/ - LP-GE-17: Send the output cap the owner set, on every path (generation-economy; saves none; severity medium) https://lmwarden.com/leanprompt/rules/lp-ge-17/ - LP-PD-01: Offer each route only the tools it can use (prompt-diet; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pd-01/ - LP-PD-02: Say each instruction once (prompt-diet; saves prefill; severity low) https://lmwarden.com/leanprompt/rules/lp-pd-02/ - LP-PD-03: Do not resend the same boilerplate on every turn (prompt-diet; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pd-03/ - LP-PD-04: Trim tool results and retrieved context at the tool boundary (prompt-diet; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-pd-04/ - LP-PD-05: Drop stale history on purpose, not by stripping (prompt-diet; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-pd-05/ - LP-PD-06: Compact serialisation for data in the prompt (prompt-diet; saves prefill; severity low) https://lmwarden.com/leanprompt/rules/lp-pd-06/ - LP-LW-01: Turn on prefix caching and set the match unit (lmwarden; saves prefill; severity high) https://lmwarden.com/leanprompt/rules/lp-lw-01/ - LP-LW-02: Keep a conversation on the replica that holds its cache (lmwarden; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-lw-02/ - LP-LW-03: One key per app or tenant; cache scope is a privacy boundary (lmwarden; saves prefill; severity medium) https://lmwarden.com/leanprompt/rules/lp-lw-03/ ## Audits Audits of public repositories. The figures are estimates from reading the code, not measurements. ### career-ops: Batch evaluation defaults to Gemini 2.5 models that reroute on Dec 1, 2026 https://lmwarden.com/leanprompt/audits/career-ops-hq__career-ops/ Project: career-ops-hq/career-ops https://github.com/career-ops-hq/career-ops. Commit e399fad, leanprompt 0.1.0-dev.15, audited 2026-11-30. Status: The maintainers have been told about this audit; no response yet.. An AI job search agent that scans job boards and scores offers; its single-offer evaluator already defaults to a current Gemini model. Every figure is an estimate from reading the code, not a measurement. ### worldmonitor: News summaries cut off at 100 tokens are cached for a day as if complete https://lmwarden.com/leanprompt/audits/koala73__worldmonitor/ Project: koala73/worldmonitor https://github.com/koala73/worldmonitor. Commit 32833c8, leanprompt 0.1.0-dev.15, audited 2026-11-30. Status: The maintainers have been told about this audit; no response yet.. A real-time global intelligence dashboard with AI news summaries; its shared LLM chain already checks for answers that stop at the limit. Every figure is an estimate from reading the code, not a measurement. ### mem0: Most TypeScript LLM providers never send the configured maxTokens https://lmwarden.com/leanprompt/audits/mem0ai__mem0/ Project: mem0ai/mem0 https://github.com/mem0ai/mem0. Commit cae3d8c, leanprompt 0.1.0-dev.15, audited 2026-11-30. Status: The maintainers have been told about this audit; no response yet.. A memory layer for AI agents in Python and TypeScript; its Anthropic and Bedrock providers already send the configured limits. Every figure is an estimate from reading the code, not a measurement. ### daily_stock_analysis: The Claude max-tokens setting can be edited, but no request reads it https://lmwarden.com/leanprompt/audits/zhulinsen__daily_stock_analysis/ Project: ZhuLinsen/daily_stock_analysis https://github.com/ZhuLinsen/daily_stock_analysis. Commit 88b577e, leanprompt 0.1.0-dev.15, audited 2026-11-30. Status: The maintainers have been told about this audit; no response yet.. An LLM-driven multi-market stock analysis system with news and dashboards; its transports already parse each provider's stop reason. Every figure is an estimate from reading the code, not a measurement. ### firecrawl: Retries meant to try new temperatures resend the same request each time https://lmwarden.com/leanprompt/audits/firecrawl__firecrawl/ Project: firecrawl/firecrawl https://github.com/firecrawl/firecrawl. Commit 73aea36, leanprompt 0.1.0-dev.15, audited 2026-11-29. Status: The maintainers have been told about this audit; no response yet.. A web scraping and search API for AI agents; its prompt-injection guard already records the usage of calls that error out. Every figure is an estimate from reading the code, not a measurement. ### DeepTutor: Research and question loops send Claude no cache marks; every round pays in full https://lmwarden.com/leanprompt/audits/hkuds__deeptutor/ Project: HKUDS/DeepTutor https://github.com/HKUDS/DeepTutor. Commit 122cd98, leanprompt 0.1.0-dev.15, audited 2026-11-29. Status: The maintainers have been told about this audit; no response yet.. An open-source AI tutor with research, question and chat agents; its chat loop already sets cache marks for Claude, and its TypeScript engine flags cut-off answers. Every figure is an estimate from reading the code, not a measurement. ### PageIndex: Two examples default to gpt-4.1, which OpenAI shuts down on Jan 14, 2027 https://lmwarden.com/leanprompt/audits/vectifyai__pageindex/ Project: VectifyAI/PageIndex https://github.com/VectifyAI/PageIndex. Commit 0f0d5f7, leanprompt 0.1.0-dev.15, audited 2026-11-29. Status: The maintainers have been told about this audit; no response yet.. A reasoning-based document index for RAG without vectors; its README already names the current model as the indexing default. Every figure is an estimate from reading the code, not a measurement. ### sublarr: Every subtitle batch carries the whole glossary, up to 100 terms https://lmwarden.com/leanprompt/audits/abrechen2__sublarr/ Project: Abrechen2/sublarr https://github.com/Abrechen2/sublarr. Commit 76d1c08, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have changed the code since this audit.. A subtitle manager for Sonarr and Radarr that translates with hosted or local models, and already sends only the glossary terms a batch uses on its local and OpenAI-compatible path. The maintainer confirmed all three reported points and fixed them in release 1.22.0 (2026-11-29). The cache mark on the changing system block was not part of the report and is still open. Every figure is an estimate from reading the code, not a measurement. ### deepwiki-open: A provider error is saved as the wiki page, so page retries never run https://lmwarden.com/leanprompt/audits/asyncfuncai__deepwiki-open/ Project: AsyncFuncAI/deepwiki-open https://github.com/AsyncFuncAI/deepwiki-open. Commit 327da97, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. A wiki generator for any GitHub repository that streams answers from many model providers and already retries a page when its provider call raises an error. Every figure is an estimate from reading the code, not a measurement. ### open-seo: Website research resends a cut-off answer unchanged https://lmwarden.com/leanprompt/audits/every-app__open-seo/ Project: every-app/open-seo https://github.com/every-app/open-seo. Commit 6f68494, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. An open source SEO tool for keyword research, rank tracking and site audits, with an MCP server so an agent can use the same data. Every figure is an estimate from reading the code, not a measurement. ### LightRAG: The Bedrock system prompt has no cache mark, so every call pays in full https://lmwarden.com/leanprompt/audits/hkuds__lightrag/ Project: HKUDS/LightRAG https://github.com/HKUDS/LightRAG. Commit b3ca0dd, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have changed the code since this audit.. A graph-based retrieval library that meters tokens per call and already has an open pull request adding prompt caching to its Anthropic binding. All three pull requests were merged on 2026-11-30: Bedrock cache marks and cache token metering (#4743, linked below), a warning on the retired Claude 3 helpers (#4744) and cached-token metering for the OpenAI Responses binding (#4745). Every figure is an estimate from reading the code, not a measurement. ### neonclipping: A cut-off model reply is never noticed, so a window of picks is lost https://lmwarden.com/leanprompt/audits/iamajmeena__neonclipping/ Project: iamajmeena/neonclipping https://github.com/iamajmeena/neonclipping. Commit 6a3b9e7, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. A local clip maker that turns long streams into captioned vertical clips, finding the moments from the audio first and reading only the chosen parts. Every figure is an estimate from reading the code, not a measurement. ### agent-service-toolkit: Bedrock replies stop at 1,024 tokens and a cut-off one is passed on as complete https://lmwarden.com/leanprompt/audits/joshuac215__agent-service-toolkit/ Project: JoshuaC215/agent-service-toolkit https://github.com/JoshuaC215/agent-service-toolkit. Commit 3d77131, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have acknowledged the findings.. A LangGraph, FastAPI and Streamlit template for agent services that builds the model for each of its many providers in one place. The maintainer confirmed both points. The fixed date in the system prompts was fixed in pull request #411 (merged 2026-11-29); the Bedrock output limit is still open, and passing the stop reason on to the client is out of scope for the project. Every figure is an estimate from reading the code, not a measurement. ### glimpser: Camera summaries are cached without checking whether the answer was cut off https://lmwarden.com/leanprompt/audits/kristopherkubicki__glimpser/ Project: KristopherKubicki/glimpser https://github.com/KristopherKubicki/glimpser. Commit 6378d2e, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. A real-time camera, timelapse and summary system for IP cameras and NVRs, whose caption path already sizes its token budget for models that count hidden reasoning. Every figure is an estimate from reading the code, not a measurement. ### OpenMontage: The proposal stage prints the whole tool registry into the agent's context https://lmwarden.com/leanprompt/audits/openmontageinc__openmontage/ Project: OpenMontageInc/OpenMontage https://github.com/OpenMontageInc/OpenMontage. Commit 2e003e6, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. An agent-driven video production pipeline whose own guide already names the short provider summary to use instead. Every figure is an estimate from reading the code, not a measurement. ### sqlchat: The default model is one OpenAI shut down on 2026-10-23 https://lmwarden.com/leanprompt/audits/sqlchat__sqlchat/ Project: sqlchat/sqlchat https://github.com/sqlchat/sqlchat. Commit 85af0b4, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. A chat interface for talking to a database in plain language, which fits as many of the schema's tables into the prompt as the model's limit allows. Every figure is an estimate from reading the code, not a measurement. ### ai-goofish-monitor: Every item's prompt carries the seller's whole rating and listing history https://lmwarden.com/leanprompt/audits/usagi-org__ai-goofish-monitor/ Project: Usagi-org/ai-goofish-monitor https://github.com/Usagi-org/ai-goofish-monitor. Commit 77f8d75, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. A second-hand listing monitor that scrapes with a browser and analyses each item with a multimodal model, caching the seller profile it scrapes. Every figure is an estimate from reading the code, not a measurement. ### webbrain: Claude requests have no cache mark, so each agent step pays for the whole prompt https://lmwarden.com/leanprompt/audits/webbrain-one__webbrain/ Project: webbrain-one/webbrain https://github.com/webbrain-one/webbrain. Commit c40d107, leanprompt 0.1.0-dev.15, audited 2026-11-28. Status: The maintainers have been told about this audit; no response yet.. An open-source AI browser agent for Chrome and Firefox; its spend meter already counts cache reads and writes, and it retries cut-off answers with a larger cap. Every figure is an estimate from reading the code, not a measurement. ### MiroFish: A report prompt names the section first, so each section pays for it again https://lmwarden.com/leanprompt/audits/666ghj__mirofish/ Project: 666ghj/MiroFish https://github.com/666ghj/MiroFish. Commit 7657031, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A multi-agent simulation and report engine on any OpenAI-compatible model; its JSON path already checks for cut-off answers and retries once. Every figure is an estimate from reading the code, not a measurement. ### screenshot-to-code: A cut-off web page is saved as finished https://lmwarden.com/leanprompt/audits/abi__screenshot-to-code/ Project: abi/screenshot-to-code https://github.com/abi/screenshot-to-code. Commit f2e5bbd, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. Turns screenshots and recordings into code with OpenAI, Anthropic and Gemini models, and stops any single generation at a $3 spend ceiling. Every figure is an estimate from reading the code, not a measurement. ### chat-with-your-data-solution-accelerator: The admin page's max tokens setting does nothing on the default model https://lmwarden.com/leanprompt/audits/azure-samples__chat-with-your-data-solution-accelerator/ Project: Azure-Samples/chat-with-your-data-solution-accelerator https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator. Commit f71c9c8, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A RAG sample on Azure OpenAI with two orchestrators, clean provider registries and a reasoning panel. A RAG sample on Azure OpenAI with two orchestrators, clean provider registries and a reasoning panel. On the default reasoning deployment every answer runs at a fixed medium effort with no output limit, and the admin page's max tokens setting is not sent. The token figures are estimates from the code; the reasoning tokens saved are assumed. Every figure is an estimate from reading the code, not a measurement. ### basecamp-cli: The skill-eval runner defaults to a model Anthropic retired in June https://lmwarden.com/leanprompt/audits/basecamp__basecamp-cli/ Project: basecamp/basecamp-cli https://github.com/basecamp/basecamp-cli. Commit d8583ae, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. Basecamp's command line and terminal workspace, whose chat summaries are cached for a day per segment and can run on a local or on-device model. Every figure is an estimate from reading the code, not a measurement. ### synapse-ceo: Past 60 messages, every turn paid again for the whole chat history https://lmwarden.com/leanprompt/audits/catalation__synapse-ceo/ Project: catalation/synapse-ceo (private repository, published with the maintainers' permission). Commit 03bbd01, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have changed the code since this audit.. An AI agent that runs company work for a founder on Z.ai's GLM, with a prompt head built byte-stable and guarded by its own test. Every figure is an estimate from reading the code, not a measurement. ### chatGPTBox: OpenAI-compatible answers cut off at the token limit are saved as if complete https://lmwarden.com/leanprompt/audits/chatgptbox-dev__chatgptbox/ Project: ChatGPTBox-dev/chatGPTBox https://github.com/ChatGPTBox-dev/chatGPTBox. Commit be0d714, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A browser extension that streams answers from 15+ providers and already flags cut-off Claude replies. A browser extension that puts a chat box, selection tools and page summaries on every site, calling 15+ providers. On the OpenAI-compatible path an answer cut off at the 2,000-token default is saved and shown as finished; the Claude path already reports it. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### NextChat: The current time leads every GPT prompt, so the prompt cache cannot match https://lmwarden.com/leanprompt/audits/chatgptnextweb__nextchat/ Project: ChatGPTNextWeb/NextChat https://github.com/ChatGPTNextWeb/NextChat. Commit 1d3dc33, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A popular open-source chat app for web and desktop across many providers; its memory summary and history window keep each request small. Every figure is an estimate from reading the code, not a measurement. ### agents-radar: 66 of 558 highlights name a project whose text the AI never saw https://lmwarden.com/leanprompt/audits/duanyytop__agents-radar/ Project: duanyytop/agents-radar https://github.com/duanyytop/agents-radar. Commit 7c5355e, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A nightly AI-news digest that is already lean: English first then translation, quiet repositories skipped, a health gate. A nightly digest pipeline on Alibaba Model Studio that is already lean: English first then translation, skipped quiet repositories, a retry policy and a health gate written up with dated incidents. The main item is not tokens: the highlights for three reports are written from a 2,000-character head that leaves most projects out. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### optscale-kompressor: Keep-warm pings go out for requests that carry no cache mark https://lmwarden.com/leanprompt/audits/hystax__optscale-kompressor/ Project: hystax/optscale-kompressor https://github.com/hystax/optscale-kompressor. Commit afcd4de, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A prompt-compression proxy for coding agents that keeps its output byte-stable for the provider cache and checks its savings against the real bill. Every figure is an estimate from reading the code, not a measurement. ### paperless-gpt: The Ollama OCR timeout is set on a vision client nothing calls https://lmwarden.com/leanprompt/audits/icereed__paperless-gpt/ Project: icereed/paperless-gpt https://github.com/icereed/paperless-gpt. Commit 1d07ced, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. paperless-gpt titles, tags and OCRs paperless-ngx documents with five LLM providers, and already caps retries so a document that keeps erroring stops costing money. A Go and React service that titles, tags and OCRs paperless-ngx documents with an LLM. OLLAMA_TIMEOUT_SECONDS is set on a vision client the app never uses, so Ollama OCR still runs with no timeout, and the tag and correspondent lists are sent in a different order for every document. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### a1o-platform: A gateway that keeps your cache marks, then bills cached tokens at full price https://lmwarden.com/leanprompt/audits/infinmalum__a1o-platform/ Project: infinmalum/a1o-platform https://github.com/infinmalum/a1o-platform. Commit 1e44601, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: Published.. A self-hosted gateway that passes native requests through byte for byte and reads every provider's usage correctly, derived from One API. A self-hosted LLM gateway that converts between the OpenAI, Anthropic and Gemini formats and bills a per-user quota from provider usage, with a built-in agent, Studio. Its billing prices cache reads as ordinary input, and requests it converts for Claude carry no cache mark. Figures are estimates from the code. leanprompt is made by the LM Warden Team, whose LM Warden is in the same market. Every figure is an estimate from reading the code, not a measurement. ### better-chatbot: The default model probably never uses its prompt cache https://lmwarden.com/leanprompt/audits/keinsaasforever__better-chatbot/ Project: keinsaasforever/better-chatbot https://github.com/keinsaasforever/better-chatbot. Commit 6f41835, leanprompt 0.1.0-dev.14, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A chat app whose 2.0 code already takes caching seriously, with Anthropic cache marks and a stable system prompt. A chat app whose 2.0 code already takes caching seriously: Anthropic cache marks, a stable system prompt with the clock moved out, slimmed history, cost-weighted metering. The open question is the default model, an Alibaba model on Vercel AI Gateway that caches only at explicit marks the app does not send it. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### aicommits: The same cut-off request is sent up to three times, unchanged https://lmwarden.com/leanprompt/audits/nutlope__aicommits/ Project: Nutlope/aicommits https://github.com/Nutlope/aicommits. Commit 98e9c4e, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A commit-message CLI for twelve providers, with a carefully bounded agentic flow that sees every staged change. A commit-message CLI with twelve providers and a carefully bounded agentic flow: diffs segmented so every change is seen, a model-call budget, validated subjects. A cut-off answer is retried with the same limit and a cut-off body can be committed as whole; the other items are small. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### pdftochat: Source page links lost their page numbers when the app moved to Chroma https://lmwarden.com/leanprompt/audits/nutlope__pdftochat/ Project: Nutlope/pdftochat https://github.com/Nutlope/pdftochat. Commit 94eb281, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A compact Together AI and LangChain demo for chatting with PDFs, with hybrid dense and sparse search in Chroma Cloud. A Next.js demo for chatting with PDFs on Together AI, LangChain.js and Chroma Cloud. Since the move to Chroma the source page buttons get no page number, and the retrieved text sits before the chat history, so no follow-up can reuse the cached conversation. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### llm-wiki-agent: Pays to write the same wiki pages again every night https://lmwarden.com/leanprompt/audits/samuraigpt__llm-wiki-agent/ Project: SamurAIGPT/llm-wiki-agent https://github.com/SamurAIGPT/llm-wiki-agent. Commit 86ab47d, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A wiki builder used mainly as a coding agent; its optional Python scripts share one small, tidy LLM helper. A wiki builder whose main mode is a coding agent following CLAUDE.md; this audit covers its secondary path, the standalone Python scripts, which share one small LLM helper. A healed entity with a space in its name is never found again, so heal.py writes it on every run. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### ChatGPT-in-Slack: Every reply is capped at 1,024 tokens, and a cut-off answer is posted as whole https://lmwarden.com/leanprompt/audits/seratch__chatgpt-in-slack/ Project: seratch/ChatGPT-in-Slack https://github.com/seratch/ChatGPT-in-Slack. Commit 9cbbcea, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A Slack bot for OpenAI and Azure OpenAI that adds new models within days and already tells users when a reasoning reply comes back empty. A Slack bot for OpenAI and Azure OpenAI that chats in threads, summarises, proofreads and translates. Every reply is capped at a fixed 1,024 completion tokens, reasoning included, and a reply cut off with some text is posted as final; the default image models were shut down in May 2026. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### learn-claude-code: No chapter marks its prompt for caching, so each agent turn is billed in full https://lmwarden.com/leanprompt/audits/shareai-lab__learn-claude-code/ Project: shareAI-lab/learn-claude-code https://github.com/shareAI-lab/learn-claude-code. Commit 448c75b, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A step-by-step teaching build of a Claude-Code-style agent: 17 chapters with tests, in three languages, and an active maintainer team. Every figure is an estimate from reading the code, not a measurement. ### AI-Video-Transcriber: Cut-off translations are saved as if they were finished https://lmwarden.com/leanprompt/audits/wendy7756__ai-video-transcriber/ Project: wendy7756/AI-Video-Transcriber https://github.com/wendy7756/AI-Video-Transcriber. Commit 7f1c619, leanprompt 0.1.0-dev.15, audited 2026-11-27. Status: The maintainers have been told about this audit; no response yet.. A self-hosted video transcriber and translator that already retries empty answers from reasoning models. A self-hosted transcriber that formats, translates and summarises videos through any OpenAI-compatible model, and already retries empty answers from reasoning models. An answer cut off at the output limit but not empty is still saved as if whole, with nothing logged. Figures are estimates from the code. Every figure is an estimate from reading the code, not a measurement. ### gpt-researcher: The same empty, cut-off request is sent up to ten times, unchanged https://lmwarden.com/leanprompt/audits/assafelovic__gpt-researcher/ Project: assafelovic/gpt-researcher https://github.com/assafelovic/gpt-researcher. Commit 9d39a2f, leanprompt 0.1.0-dev.15, audited 2026-11-26. Status: The maintainers have been told about this audit; no response yet.. A research agent that already meters every attempt and keeps a standard report to three calls. A research agent that already meters every attempt and tracks its costs closely; a standard report is three calls. The largest finding, a cut-off empty answer resent unchanged, continues the project's own issue #2251; pull request #2381, opened with this audit, proposes the fix. Audited with leanprompt 0.1.0-dev.11, re-scored with 0.1.0-dev.14. Every figure is an estimate from reading the code, not a measurement. ### anything-llm: Changing documents come before the chat history, so the cache cannot reuse it https://lmwarden.com/leanprompt/audits/mintplex-labs__anything-llm/ Project: Mintplex-Labs/anything-llm https://github.com/Mintplex-Labs/anything-llm. Commit b014470, leanprompt 0.1.0-dev.15, audited 2026-11-26. Status: The maintainers have been told about this audit; no response yet.. An all-in-one AI app with 40 chat providers, whose maintainers already describe the fix in their own issue. The three largest cache findings are already planned in the maintainers' issue #6401, so they are shown as already known and left out of the score; the audit adds the sliding history window and the agent loop. Metering is in their open pull request #6747 and the tool-argument re-ask was declined in #7102. Audited with 0.1.0-dev.11, re-scored with 0.1.0-dev.14. Every figure is an estimate from reading the code, not a measurement. ### leanprompt: A timestamp at the top of the prompt means no call can reuse the cache https://lmwarden.com/leanprompt/audits/podwarden__leanprompt/ Project: Podwarden/leanprompt https://github.com/Podwarden/leanprompt. Commit 67e1586, leanprompt 0.1.0-dev.12, audited 2026-11-26. Status: Demonstration: an audit of leanprompt’s own example app.. leanprompt's own example chat app, which keeps its whole handbook in one system prompt. A demonstration on leanprompt's own example app. The before form starts its system prompt with the current time, so no call can reuse the handbook that follows it. Every figure is an estimate from reading the code, not a measurement. ### rootwise: A daily spending cap that can be overshot by about a third https://lmwarden.com/leanprompt/audits/wyattlindsey__rootwise/ Project: wyattlindsey/rootwise https://github.com/wyattlindsey/rootwise. Commit ff18600, leanprompt 0.1.0-dev.13, audited 2026-11-26. Status: The maintainers have been told about this audit; no response yet.. A gardening-advice demo on Claude that already marks its tools and system prompt for Anthropic's cache. A gardening-advice demo on Claude with a tool loop. It already marks its tools and system prompt for Anthropic's cache; the audit found the tool loop's own messages unmarked, and, outside the rules, two gaps in the daily budget meter. Audited with leanprompt 0.1.0-dev.11, re-scored with 0.1.0-dev.13. Every figure is an estimate from reading the code, not a measurement. ### bilingual_book_maker: A cut-off batch was paid for three times. Fixed the next day. https://lmwarden.com/leanprompt/audits/yihong0618__bilingual_book_maker/ Project: yihong0618/bilingual_book_maker https://github.com/yihong0618/bilingual_book_maker. Commit 5e40cbc, leanprompt 0.1.0-dev.15, audited 2026-11-26. Status: The maintainers have changed the code since this audit.. A book translator that is already very cache-aware: session mode, Anthropic cache marks, cached-token metering. A book translator that is already very cache-aware: session mode, Anthropic cache marks, cached-token metering, the batch APIs. A retry of a cut-off batch was fixed in pull request #590 (merged 2026-11-27); a question about stacked timeouts and an unchecked cut-off reply remain. Audited with leanprompt 0.1.0-dev.11, re-scored with 0.1.0-dev.13. Every figure is an estimate from reading the code, not a measurement.