# 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. leanprompt is a set of skills for coding assistants (Claude Code, Codex, Cursor, OpenCode and any agent that reads AGENTS.md) by the LM Warden Team. Install it from a project root with `npx leanprompt install`. It is not a prompt-compression library: it works on the app the assistant is building. No telemetry, no hosted service. Source: https://github.com/Podwarden/leanprompt ## Pages - [Home](https://lmwarden.com/leanprompt/): what leanprompt does, the install command, a before and after example - [How it works](https://lmwarden.com/leanprompt/how-it-works/): the problem, the audit, the rules at a glance and how to prove a fix - [Install](https://lmwarden.com/leanprompt/install/): every assistant, project or global, the Claude Code plugin, Windows - [The score and the badge](https://lmwarden.com/leanprompt/score/): measured and static scores, calibration, the shields.io badge - [Rules](https://lmwarden.com/leanprompt/rules/): all rules, grouped by skill - [Examples](https://lmwarden.com/leanprompt/examples/): example apps in before and after forms with answer checks - [Audits](https://lmwarden.com/leanprompt/audits/): audits of public repositories, estimates from the code, with the maintainers’ response - [News](https://lmwarden.com/leanprompt/news/): releases and posts ## Rules - [LP-PC-01: Put cache marks where the provider needs them](https://lmwarden.com/leanprompt/rules/lp-pc-01/): prefill-cache, saves prefill, severity high - [LP-PC-02: Stable content first, without hurting meaning](https://lmwarden.com/leanprompt/rules/lp-pc-02/): prefill-cache, saves prefill, severity high - [LP-PC-03: No ids, timestamps, versions or paths at the top of the prompt](https://lmwarden.com/leanprompt/rules/lp-pc-03/): prefill-cache, saves prefill, severity high - [LP-PC-04: Fixed tool order and JSON key order](https://lmwarden.com/leanprompt/rules/lp-pc-04/): prefill-cache, saves prefill, severity high - [LP-PC-05: Tool lists grow only at the end](https://lmwarden.com/leanprompt/rules/lp-pc-05/): prefill-cache, saves prefill, severity medium - [LP-PC-06: Append-only history](https://lmwarden.com/leanprompt/rules/lp-pc-06/): prefill-cache, saves prefill, severity high - [LP-PC-07: Shared context before per-user context](https://lmwarden.com/leanprompt/rules/lp-pc-07/): prefill-cache, saves prefill, severity medium - [LP-PC-08: Cache-aware compaction](https://lmwarden.com/leanprompt/rules/lp-pc-08/): prefill-cache, saves prefill, severity medium - [LP-PC-09: Consistent reasoning handling; thinking fixed per session](https://lmwarden.com/leanprompt/rules/lp-pc-09/): prefill-cache, saves both, severity high - [LP-PC-10: Stable image and attachment placement](https://lmwarden.com/leanprompt/rules/lp-pc-10/): prefill-cache, saves prefill, severity medium - [LP-PC-11: Keep pauses inside the cache lifetime](https://lmwarden.com/leanprompt/rules/lp-pc-11/): prefill-cache, saves prefill, severity low - [LP-PC-12: Do not split one prefix across models or keys that do not share a cache](https://lmwarden.com/leanprompt/rules/lp-pc-12/): prefill-cache, saves prefill, severity medium - [LP-GE-01: n samples in one request](https://lmwarden.com/leanprompt/rules/lp-ge-01/): generation-economy, saves prefill, severity medium - [LP-GE-02: Batch independent questions about one context](https://lmwarden.com/leanprompt/rules/lp-ge-02/): generation-economy, saves both, severity medium - [LP-GE-03: Output and thinking budgets that fit the task](https://lmwarden.com/leanprompt/rules/lp-ge-03/): generation-economy, saves generation, severity high - [LP-GE-04: Stream long outputs; timeouts that match generation time](https://lmwarden.com/leanprompt/rules/lp-ge-04/): generation-economy, saves both, severity high - [LP-GE-05: Retry only retryable errors; never retry a truncation unchanged](https://lmwarden.com/leanprompt/rules/lp-ge-05/): generation-economy, saves both, severity high - [LP-GE-06: Cache exact responses for deterministic requests](https://lmwarden.com/leanprompt/rules/lp-ge-06/): generation-economy, saves both, severity medium - [LP-GE-07: Batch API for work that can wait](https://lmwarden.com/leanprompt/rules/lp-ge-07/): generation-economy, saves both, severity medium - [LP-GE-08: Route trivially small calls to a small model](https://lmwarden.com/leanprompt/rules/lp-ge-08/): generation-economy, saves both, severity medium - [LP-GE-09: Predicted outputs for mostly unchanged text](https://lmwarden.com/leanprompt/rules/lp-ge-09/): generation-economy, saves generation, severity low - [LP-GE-10: Structured output instead of parse-and-re-ask](https://lmwarden.com/leanprompt/rules/lp-ge-10/): generation-economy, saves generation, severity high - [LP-GE-11: Meter every billed token, cached and unfinished ones too](https://lmwarden.com/leanprompt/rules/lp-ge-11/): generation-economy, saves none, severity medium - [LP-GE-12: Read the finish reason before using an answer](https://lmwarden.com/leanprompt/rules/lp-ge-12/): generation-economy, saves none, severity high - [LP-GE-13: Default to a model the provider still serves](https://lmwarden.com/leanprompt/rules/lp-ge-13/): generation-economy, saves none, severity high - [LP-GE-14: Build both sides of a cache or change key the same way](https://lmwarden.com/leanprompt/rules/lp-ge-14/): generation-economy, saves both, severity high - [LP-GE-15: Give each timeout one meaning, and set one](https://lmwarden.com/leanprompt/rules/lp-ge-15/): generation-economy, saves none, severity medium - [LP-GE-16: Fall back to another model only on errors it can fix](https://lmwarden.com/leanprompt/rules/lp-ge-16/): generation-economy, saves none, severity medium - [LP-GE-17: Send the output cap the owner set, on every path](https://lmwarden.com/leanprompt/rules/lp-ge-17/): generation-economy, saves none, severity medium - [LP-PD-01: Offer each route only the tools it can use](https://lmwarden.com/leanprompt/rules/lp-pd-01/): prompt-diet, saves prefill, severity medium - [LP-PD-02: Say each instruction once](https://lmwarden.com/leanprompt/rules/lp-pd-02/): prompt-diet, saves prefill, severity low - [LP-PD-03: Do not resend the same boilerplate on every turn](https://lmwarden.com/leanprompt/rules/lp-pd-03/): prompt-diet, saves prefill, severity medium - [LP-PD-04: Trim tool results and retrieved context at the tool boundary](https://lmwarden.com/leanprompt/rules/lp-pd-04/): prompt-diet, saves prefill, severity high - [LP-PD-05: Drop stale history on purpose, not by stripping](https://lmwarden.com/leanprompt/rules/lp-pd-05/): prompt-diet, saves prefill, severity medium - [LP-PD-06: Compact serialisation for data in the prompt](https://lmwarden.com/leanprompt/rules/lp-pd-06/): prompt-diet, saves prefill, severity low - [LP-LW-01: Turn on prefix caching and set the match unit](https://lmwarden.com/leanprompt/rules/lp-lw-01/): lmwarden, saves prefill, severity high - [LP-LW-02: Keep a conversation on the replica that holds its cache](https://lmwarden.com/leanprompt/rules/lp-lw-02/): lmwarden, saves prefill, severity medium - [LP-LW-03: One key per app or tenant; cache scope is a privacy boundary](https://lmwarden.com/leanprompt/rules/lp-lw-03/): lmwarden, saves prefill, severity medium ## Examples - [compaction-rewrite](https://lmwarden.com/leanprompt/examples/compaction-rewrite/) - [dated-chat](https://lmwarden.com/leanprompt/examples/dated-chat/) - [dict-tools-agent](https://lmwarden.com/leanprompt/examples/dict-tools-agent/) - [rag-chunks-first](https://lmwarden.com/leanprompt/examples/rag-chunks-first/) - [repeat-samples](https://lmwarden.com/leanprompt/examples/repeat-samples/) - [timeout-retry](https://lmwarden.com/leanprompt/examples/timeout-retry/) ## Audits - [MiroFish: A report prompt names the section first, so each section pays for it again](https://lmwarden.com/leanprompt/audits/666ghj__mirofish/): https://github.com/666ghj/MiroFish at 7657031, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [screenshot-to-code: A cut-off web page is saved as finished](https://lmwarden.com/leanprompt/audits/abi__screenshot-to-code/): https://github.com/abi/screenshot-to-code at f2e5bbd, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [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/): https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator at f71c9c8, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [basecamp-cli: The skill-eval runner defaults to a model Anthropic retired in June](https://lmwarden.com/leanprompt/audits/basecamp__basecamp-cli/): https://github.com/basecamp/basecamp-cli at d8583ae, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [synapse-ceo: Past 60 messages, every turn paid again for the whole chat history](https://lmwarden.com/leanprompt/audits/catalation__synapse-ceo/): https://gitlab.com/catalation/synapse-ceo at 03bbd01, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [chatGPTBox: OpenAI-compatible answers cut off at the token limit are saved as if complete](https://lmwarden.com/leanprompt/audits/chatgptbox-dev__chatgptbox/): https://github.com/ChatGPTBox-dev/chatGPTBox at be0d714, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [NextChat: The current time leads every GPT prompt, so the prompt cache cannot match](https://lmwarden.com/leanprompt/audits/chatgptnextweb__nextchat/): https://github.com/ChatGPTNextWeb/NextChat at 1d3dc33, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [agents-radar: 66 of 558 highlights name a project whose text the AI never saw](https://lmwarden.com/leanprompt/audits/duanyytop__agents-radar/): https://github.com/duanyytop/agents-radar at 7c5355e, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [optscale-kompressor: Keep-warm pings go out for requests that carry no cache mark](https://lmwarden.com/leanprompt/audits/hystax__optscale-kompressor/): https://github.com/hystax/optscale-kompressor at afcd4de, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [paperless-gpt: The Ollama OCR timeout is set on a vision client nothing calls](https://lmwarden.com/leanprompt/audits/icereed__paperless-gpt/): https://github.com/icereed/paperless-gpt at 1d07ced, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [a1o-platform: A gateway that keeps your cache marks, then bills cached tokens at full price](https://lmwarden.com/leanprompt/audits/infinmalum__a1o-platform/): https://github.com/infinmalum/a1o-platform at 1e44601, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [better-chatbot: The default model probably never uses its prompt cache](https://lmwarden.com/leanprompt/audits/keinsaasforever__better-chatbot/): https://github.com/keinsaasforever/better-chatbot at 6f41835, 2026-11-27, leanprompt 0.1.0-dev.14; estimates from the code, not measurements - [aicommits: The same cut-off request is sent up to three times, unchanged](https://lmwarden.com/leanprompt/audits/nutlope__aicommits/): https://github.com/Nutlope/aicommits at 98e9c4e, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [pdftochat: Source page links lost their page numbers when the app moved to Chroma](https://lmwarden.com/leanprompt/audits/nutlope__pdftochat/): https://github.com/Nutlope/pdftochat at 94eb281, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [llm-wiki-agent: Pays to write the same wiki pages again every night](https://lmwarden.com/leanprompt/audits/samuraigpt__llm-wiki-agent/): https://github.com/SamurAIGPT/llm-wiki-agent at 86ab47d, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [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/): https://github.com/seratch/ChatGPT-in-Slack at 9cbbcea, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [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/): https://github.com/shareAI-lab/learn-claude-code at 448c75b, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [AI-Video-Transcriber: Cut-off translations are saved as if they were finished](https://lmwarden.com/leanprompt/audits/wendy7756__ai-video-transcriber/): https://github.com/wendy7756/AI-Video-Transcriber at 7f1c619, 2026-11-27, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [gpt-researcher: The same empty, cut-off request is sent up to ten times, unchanged](https://lmwarden.com/leanprompt/audits/assafelovic__gpt-researcher/): https://github.com/assafelovic/gpt-researcher at 9d39a2f, 2026-11-26, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [anything-llm: Changing documents come before the chat history, so the cache cannot reuse it](https://lmwarden.com/leanprompt/audits/mintplex-labs__anything-llm/): https://github.com/Mintplex-Labs/anything-llm at b014470, 2026-11-26, leanprompt 0.1.0-dev.15; estimates from the code, not measurements - [leanprompt: A timestamp at the top of the prompt means no call can reuse the cache](https://lmwarden.com/leanprompt/audits/podwarden__leanprompt/): https://github.com/Podwarden/leanprompt at 67e1586, 2026-11-26, leanprompt 0.1.0-dev.12; estimates from the code, not measurements - [rootwise: A daily spending cap that can be overshot by about a third](https://lmwarden.com/leanprompt/audits/wyattlindsey__rootwise/): https://github.com/wyattlindsey/rootwise at ff18600, 2026-11-26, leanprompt 0.1.0-dev.13; estimates from the code, not measurements - [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/): https://github.com/yihong0618/bilingual_book_maker at 5e40cbc, 2026-11-26, leanprompt 0.1.0-dev.15; estimates from the code, not measurements ## Optional - [Changelog](https://lmwarden.com/leanprompt/news/changelog/): every release, newest first - [LM Warden](https://lmwarden.com/llms.txt): the self-hosted LLM server by the same team