PerfLens

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.

Time until the main content appears on a mid-range phone. Same page, before and after fixing what PerfLens found.
Before
Score 39
52 s
After PerfLens fixes
Score 100
910 ms
0s5s10s15s20s25s30s35s40s45s50s55s

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.

  1. You

    Ask in plain English: “why is this page slow?”

  2. Your AI assistant

    Claude Code, Cursor or another MCP client calls PerfLens.

  3. PerfLens

    Runs the test, keeps what matters, ranks the fixes.

  4. Chrome + Lighthouse

    Google's speed test, in a hidden browser on your machine.

requestaudit
short, ranked answerresults

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.

Score before
39
Score after
100

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.

LCP
When does the main content appear?
52 s910 ms
FCP
When does anything appear?
2.8 s695 ms
TBT
How long is the page frozen while loading?
1.0 s0 ms
CLS
How much does the layout jump around?
0.1960
SI
How quickly does the screen fill in?
2.8 s695 ms

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.
Chat · AI coding assistantperflens connected

> 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. 1. Load the LCP element sooner · ~50 s LCP
  2. 2. Serve smaller, modern images · ~49 s LCP, 8.0 MB
  3. 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

Illustrative chat. Tool results are the real audit numbers from the demo.

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-mcp

On native Windows: claude mcp add perflens -- cmd /c npx -y perflens-mcp