Why is my
site slow?
Ask your AI coding assistant. PerfLens lets Claude Code, Cursor and other AI assistants run Google's Lighthouse speed test, understand the results and fix what matters most, right from the chat.
How it works
Slow pages lose visitors and rank lower in search. Google's Lighthouse explains why, but in a long technical report. PerfLens runs it for your AI assistant and hands back only what matters, ranked, so the assistant can explain it and make the changes.
- You
Ask in plain English: “why is this page slow?”
- Your AI assistant
Claude Code, Cursor or another MCP client calls PerfLens.
- PerfLens
Runs the test, keeps what matters, ranks the fixes.
- Chrome + Lighthouse
Google's speed test, in a hidden browser on your machine.
One page.
Audited. Fixed.
I built a small coffee shop page with mistakes that are common on real sites: a huge hero image loaded late, heavy JavaScript, a banner that pushes content down. PerfLens audited it and ranked the fixes; the fixed version applies them. Same content, same design.
Lighthouse performance score, out of 100, on a simulated mid-range phone on 4G. 90 and above is good. Real Lighthouse 12.8.2 runs, median of 3; lab results vary a little between runs.
Thin bar: before. Thick bar: after. Shorter is better; ticks mark where “good” ends and “poor” begins.
In your editor
There's no dashboard to learn. PerfLens gives your assistant four tools, and you just ask questions.
- audit_url“How fast is localhost:3000 on mobile?”
- Runs a Lighthouse speed test on any page, even one running on your own machine, and returns the score, the key measurements and the biggest problems with the files causing them.
- suggest_fixes“What should I fix first?”
- A short to-do list: what to change, why, how much effort, and roughly how much it helps. Best value first.
- compare_urls“Did my change make it faster?”
- Compares two pages, or one page before and after a change, and ignores differences small enough to be run-to-run noise.
- explain_metric“What is CLS and why is mine bad?”
- Explains a speed measurement in plain English: what it means, what good looks like, and what usually causes problems.
> Why is /demo/slow.html so slow on phones? Fix the worst problems.
perflens audit_url("/demo/slow.html", mobile)
score 39/100 · LCP 52 s · TBT 1.0 s · CLS 0.196
perflens suggest_fixes(audit)
- 1. Load the LCP element sooner · ~50 s LCP
- 2. Serve smaller, modern images · ~49 s LCP, 8.0 MB
- 3. Prevent layout shifts · ~0.196 CLS
On a phone, the main image shows up after 52 s. It's a 3.7 MB PNG that JavaScript adds late and lazy-loads. I'll put it in the HTML as a small AVIF with high priority, reserve space for the banner, and defer the blocking script…
perflens compare_urls(before, after)
score 39 → 100 · LCP 52 s → 910 ms · CLS 0.196 → 0
Install
Free and open source. Runs on your own machine with no account or API key, and audits public sites and local development servers alike. Needs Node.js 20+ and Chrome, Chromium or Edge.
Then try: “audit localhost:3000 on mobile and tell me what to fix first.”
Run in your terminal:
claude mcp add perflens -- npx -y perflens-mcpOn native Windows: claude mcp add perflens -- cmd /c npx -y perflens-mcp