Microsoft shaved 4.5% off clarity.js with 50+ AI agent experiments

gaganghotra_ · x · 2026-11-03

Microsoft Clarity engineer Manu Nair describes using pi, an AI coding agent with autoresearch, to shrink clarity.js: the agent made a change, built the script, measured compressed output, ran tests, and kept or reverted based on results. After 50+ experiments, the script lost 1,257 gzip bytes (4.5%) with no functionality or compatibility sacrificed.

Key insights:

The workflow — agent-driven experiments with compressed size as the metric — is directly reusable.

Original post →

More from coding & agent

coding & agent channel →