Simon Willison just solved a four-year-old technical headache by handing it to an AI agent. According to Willison, he asked Claude Opus 4.8 (running in Claude Code for web) to figure out how to run Python ASGI apps inside Pyodide using Service Workers, and the result works. It’s a small story with a big lesson: the way you frame and delegate a hard, exploratory problem to an AI coding agent is itself a skill worth learning.
Here’s what Willison was up against and how the approach unfolded, step by step.
Quick Start
This guide walks through the technique Willison used to crack a stubborn browser problem with an AI agent. You’ll learn how he framed the task, what changed, and how you can borrow the same workflow. You need a working knowledge of Python in the browser (Pyodide/WebAssembly) and access to an AI coding agent like Claude Code. No deep WebAssembly expertise required to follow the reasoning.
The problem he started with
Willison built Datasette Lite, a version of his Datasette tool that runs entirely in the browser using Pyodide in WebAssembly. When he first built it four years ago, he used Web Workers plus code that intercepts navigation operations and fetches the generated HTML by running the Python app.
That worked, but it had a real flaw. Any JavaScript inside script tags would not execute. That broke some Datasette functionality and a whole lot of Datasette plugins. Knowing the limit of your current setup is the part most people skip, and it’s exactly what made the next step possible.
Step 1: Name the better architecture
Instead of patching the old Web Workers approach, Willison identified a cleaner target: run the Python ASGI apps in Pyodide using Service Workers instead. Service Workers can intercept network requests and return responses while letting the page render normally, scripts included. Picking the right architecture before writing code is what kept this from being another patch on a broken foundation.
Step 2: Hand the task to the agent
Willison set Claude Opus 4.8 the task inside Claude Code for web. He didn’t ask for a vague “make it better.” He gave a specific, well-scoped problem: get Python ASGI apps running in Pyodide via Service Workers. The clearer the target, the better an agent performs. A precise prompt is the difference between useful output and a pile of guesses.
Step 3: Verify with real demos
The proof wasn’t a claim, it was working code. Willison points to a basic ASGI demo and a second demo that runs Datasette 1.0a31 in the browser. Always confirm an AI’s work by running it, not by trusting the explanation. Two live demos beat any amount of confident prose.
Step 4: Understand it before you ship it
This is the part that stands out. Willison is candid: “I’m still getting my head around exactly how it works.” He’s treating the AI’s solution as a draft to understand, not a black box to deploy. Only once he’s clear on the mechanics does he plan to upgrade Datasette Lite itself.
That’s the discipline worth copying. An agent can hand you a working solution faster than you’d build it alone, but shipping code you don’t understand is how you inherit bugs you can’t fix.
Why this matters
This is a quiet preview of how experienced developers are starting to work. The human sets direction, names the architecture, and verifies. The agent does the heavy lifting of figuring out an unfamiliar technical path. Willison didn’t outsource his judgment. He outsourced the grind.
It also pushes the browser-as-runtime idea forward. Running full Python web apps client-side, with plugins and JavaScript intact, means richer tools that need no server. That’s cheaper hosting and easier sharing for anyone building data tools.
Next steps
- Find a stalled project where you already know the current approach’s limit. That clarity is your best prompt.
- Name the architecture you actually want before asking an agent to build it.
- Demand runnable proof, then read the code until you understand it.
- Watch Willison’s site for the promised Datasette Lite upgrade, where the full technique should land in production.
Full details and the live demos are available at the original source.