Chapters
See what your app sends, and what the engine had to read again.
Prompt Lens shows each request’s prompt part by part: which parts the engine served from its cache, which it had to compute again, and the fixes that would save the most. It is on by default, and keeps prompts in memory only unless you turn on Keep for a key.
Why the start of the prompt matters
Every request resends its whole prompt. The engine skips the part it has already read, but only while that part is byte for byte the same and comes first. So keep the system prompt and the tool definitions stable and at the start, and put what changes at the end.
Small things break that reuse:
- a timestamp, or any line that changes every turn, in the system prompt;
- tools listed in a different order from one request to the next;
- tools the model never calls, resent with every request;
- the same tool result sent twice.
In the session the video opens with, 14 of 17 tools were never called, and about 177,000 tokens were sent for nothing in each session.
What it shows
- The request. A map of the prompt: which parts match earlier requests, exactly or loosely, and what the engine took from its cache.
- Findings on this request. Why it was computed again, how it was built (unused tools, repeated results, a large head, growing context) and how the reply went.
- Sessions. Once a session has been quiet for 10 minutes it gets a scorecard: Efficiency, Construction and Response from 0 to 100, and its top three fixes, priced where you have set a price card.
- Trends. Prompt versions, detected or named by your client with an
X-Prompt-Versionheader, and whether the last change helped. - The live stream. A key’s prompts, thinking, replies and tool calls as they happen, while the page is open. Keep stores a key’s last 50 requests on disk.
Each key’s holder sees that key’s requests; an admin sees every key. A report downloads as HTML or JSON.
Let your coding agent make the changes
LM Warden serves an MCP server at /api/lens/mcp. Connect your coding agent with its LM Warden key and it can list your sessions and requests, read the findings and scorecards, diff two turns, wait for the next request and load guides written for it, then change your code and measure again.
The same rules ship as leanprompt: free, open-source skills for coding assistants that make your prompts cacheable, and a command-line tool that measures the result.
What it covers
Requests to the models on your GPUs, from OpenAI- and Anthropic-compatible clients. Requests the Claude Code router passes on to Anthropic do not appear in Prompt Lens yet.