Performance advice without a trace is folklore. With chrome-devtools-mcp, an agent records a real performance trace of your page, reads the LCP breakdown and layout-shift culprits from the trace itself, proposes a fix, and — after you apply it — re-traces to prove the metric moved. The loop is closed by measurement, not by plausibility.
Tier: Core · Workflow area: Performance & debugging
This playbook runs that loop on Core Web Vitals — LCP, INP, CLS — for a page you own, and establishes "no trace, no claim" as the team's performance discipline.
Skip it for API-bound slowness (fix the backend first) or for a page you cannot run locally or on a preview URL the agent can reach.
chrome-devtools-mcp configured and able to launch or attach to Chrome.Record the baseline trace under the fixed condition. Direct the agent explicitly:
Using chrome-devtools-mcp: emulate 4x CPU throttling and Fast 4G,
navigate to http://localhost:3000/plans with a cold cache, and record
a performance trace of the load. Report LCP, CLS, and TBT, the LCP
element and its phase breakdown (TTFB / load delay / load time /
render delay), and the top 3 insights from the trace.
Save the reported numbers as the baseline. Run the trace twice; if the two runs disagree wildly, stabilize the environment before proceeding.
Make the agent diagnose from the trace, not from vibes. The trace tells you where the metric's time actually went — demand that structure:
preload, image behind JS); load-time points at asset weight.Reject any diagnosis the agent cannot tie to a trace event. "Consider code-splitting" is only admissible if the trace shows script evaluation blocking the LCP phase it names.
Apply one fix at a time, smallest first. Have the agent rank fixes by expected impact on the failing metric and by risk, then implement the top one — a fetchpriority="high" and preload on the LCP image, explicit dimensions on the shifting embed, deferring the analytics bundle. One change per loop iteration; batched fixes make the re-trace unattributable.
Re-trace under the identical condition and compare. Same throttle, same cache state, same URL. The metric either moved past the threshold, moved insufficiently, or regressed something else (watch the other two vitals in the same report — LCP fixes that lazy-load aggressively have a habit of paying for it in CLS). Keep the fix only with the receipts; revert or iterate otherwise. Repeat the loop until the failing metric clears its threshold with margin.
Lock the win in. Land the changes with before/after numbers in the PR description, add a Lighthouse CI (or equivalent) budget assertion at the achieved level so the next regression fails a check instead of a user, and confirm in RUM/CrUX over the following weeks that field data followed the lab win.
The unit of performance work is one loop iteration: trace → trace-grounded diagnosis → single fix → re-trace under identical conditions. An optimization without its before/after pair does not exist.
The loop runs entirely against local or preview environments — the MCP server drives a local Chrome; no page content needs to leave the machine except what the model sees in trace summaries.
Do not point an agent-driven browser at production pages with real user sessions or run traces through pages containing customer data — trace summaries and screenshots can carry that data into the model context. Use local builds, preview deploys, or scrubbed staging.