Get more from every LLM call your app makes.

Your coding assistant makes prompts cacheable, cuts dead weight, stops wasted output and speeds up first tokens, without changing the answers.

npx leanprompt install

From your project root. Needs Node 20.19 or newer. It shows every file it will write and asks before writing. Then reload your assistant and type /leanprompt init.

Works with Claude Code, Codex, Cursor, OpenCode and any agent that reads AGENTS.md.

One example app, before and after one fix

The audit page for dated-chat. Before, the system prompt starts with the time to the second, so no call can reuse the handbook that follows it. After, the time moves to the newest message.

Without leanprompt One finding at app.ts line 11; static score 46.
The leanprompt audit page for the dated-chat example before the fix: one place where the app pays for tokens it does not need, 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
With leanprompt No open findings, one fixed; static score 100.
The leanprompt audit page for the same example after the fix: no open findings, 1 finding fixed, static score 100

Both pages show estimates from the code, not measurements. /leanprompt measure turns a fix into a before and after number.

Audits of public projects

The same audit, run on open-source apps. Each one is dated, names the commit it read, and links where the maintainers were told and what they said.

  • Cache never hits Fixed upstream

    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.

    ≈ 2,000,000 tokens per 1,000 calls, prompt tokens the cache could have served, from a history window that slid every turn estimate

    catalation/synapse-ceo ·

  • Retry loop Fixed upstream

    A book translator that is already very cache-aware: session mode, Anthropic cache marks, cached-token metering.

    ≈ 58,000 tokens per 1,000 calls, for a cut-off batch sent twice more, before the fix estimate

    yihong0618/bilingual_book_maker ·

  • Cache never hits Reported

    A chat app whose 2.0 code already takes caching seriously, with Anthropic cache marks and a stable system prompt.

    ≈ 8,000,000 tokens per 1,000 calls, for default-model chats, if the gateway does not cache them estimate

    keinsaasforever/better-chatbot ·

See all 23 audits

What your assistant does with it

  1. Audit

    /leanprompt audit finds every LLM call in the app and ranks where it loses tokens and time: a prompt the cache cannot reuse, dead weight, output thrown away.

  2. Fix

    /leanprompt fix checks each finding, shows a diff and applies it on your yes. A fix that changes what the model is asked or answers is not a fix.

  3. Prove

    /leanprompt measure compares the provider’s own usage numbers before and after, and /leanprompt score turns them into one number you can put in CI.

How it works

38 rules, each with a way to check it

Every rule says how to detect the problem in code, the smallest fix, what the fix must not break, and how to verify it. Provider facts carry a checked date and a source.

leanprompt is not a prompt-compression library, and it works on the app the assistant is building, not on the assistant’s own bill. No telemetry, no proxy, no hosted service, no account. It does not edit your code without asking.