Related ToolsClaude CodeClaudeCursorAider

Developer Uses Claude Code to Self-Monitor and Fix Lighthouse Scores, Hits 95/100/100/100

Claude by Anthropic
Image: Anthropic

What Happened

A developer shared on Reddit's r/ClaudeAI that they set up Claude Code to run Google Lighthouse audits on their site, read the results, and then autonomously fix the flagged issues. The loop ran continuously - audit, identify problems, write fixes, re-audit - until the scores stopped improving.

The final result: 95 for Performance, 100 for Accessibility, 100 for Best Practices, and 100 for SEO on Google PageSpeed Insights. That is a near-perfect score that most developers spend days manually chasing.

The setup involved giving Claude Code access to both the codebase and the ability to run Lighthouse CLI commands. Claude Code would parse the JSON output from each audit, identify the specific issues dragging scores down, implement fixes in the code, and then re-run the audit to verify improvements. The whole process ran with minimal human intervention.

Why It Matters

Web performance optimization is one of those tasks that developers know they should do but constantly defer. Lighthouse audits generate a list of specific, actionable issues - render-blocking resources, unoptimized images, missing meta tags, accessibility violations - but fixing them is tedious, repetitive work. Each fix is small, but there are dozens of them.

This use case shows a pattern that applies beyond just Lighthouse scores. The core idea is: give an AI coding agent a measurable target, a way to check its own progress, and let it iterate. That feedback loop is what separates useful AI coding from the "generate and hope" approach.

For teams that care about Core Web Vitals (which directly affect Google search rankings), this could compress what used to be a multi-day optimization sprint into a single automated session. Accessibility scores of 100 are particularly hard to achieve manually because they require checking every element against WCAG guidelines.

Our Take

This is one of the better Claude Code use cases we have seen because it plays to the tool's actual strengths: deterministic feedback, small incremental changes, and clear success criteria. Lighthouse gives you a score. Either it went up or it did not. There is no ambiguity for the model to get confused by.

The limitation worth noting: Lighthouse Performance scores can be inconsistent between runs, especially on real-world connections. A score of 95 in one run might be 88 in the next without any code changes. The developer likely ran these in a controlled environment.

Still, the approach is sound and replicable. If you are using Claude Code already, setting up a similar loop for your own projects is straightforward. The key insight is not "Claude Code can fix performance issues" - it is that giving AI agents measurable feedback loops produces dramatically better results than one-shot prompting. This pattern will show up everywhere in 2026.