[KongchangAI]
· 2 min read· 1,353 words

Running a PS2 Emulator in the Browser with Claude: Inside TabStationToo

Running a PS2 Emulator in the Browser with Claude: Inside TabStationToo

TabStationToo: a browser PS2 emulator built on PCSX2, mostly coded by Claude.

TabStationToo is an experimental project that runs a PS2 emulator in a browser tab, rebuilt from the PCSX2 (GPL-3.0) core with a new frontend so users can load their own BIOS and disc images. Most code was written by Claude Opus 5.5, with humans setting rules, testing, and making decisions; CLAUDE.md/AGENTS.md enforces constraints like crediting PCSX2 and testing before claiming features work. It replaces native JIT with WebAssembly and ports rendering to WebGPU, requiring pixel-identical output and full attempt logs during optimization.

A PS2 in a Browser Tab

Cramming a PS2 emulator into a browser tab sounds like a weekend joke, but the TabStationToo project actually pulled it off. The author shared the whole process on Reddit: together with a friend, they took the core of PCSX2 (GPL-3.0), reworked it to run in the browser, and built a new frontend around it. Users open the page, select their own BIOS and disc image folder, and can start playing right away.

TabStationToo project share

What makes this project unusual isn't "emulator in a browser" itself, but how it was built: the vast majority of the code was written by Claude (Opus 5.5), with humans handling decisions, testing, and feedback. The author admits plainly: "We decided what to build, tested games, and reported issues—Claude did most of the programming."

When AI Becomes the Primary Programmer

The repo contains a CLAUDE.md/AGENTS.md file that Claude reads at the start of every session. It describes the project background, browser constraints, build and test methods, and two hard rules: PCSX2 must be credited; no feature may be claimed as working without testing.

The key to this collaboration model is putting AI inside a constrained engineering process rather than letting it run free. The author didn't treat Claude as a "code generator" but as a team member who needs rules, verification, and iteration.

What are CLAUDE.md / AGENTS.md

AGENTS.md (and the Claude-specific CLAUDE.md) is a convention that has emerged in the AI coding tool ecosystem in recent years: place a Markdown file at the repo root that states, in natural language, the project background, build commands, testing approach, code style, and hard prohibitions. Tools like Claude Code and Cursor automatically read this file at the start of every session and inject it as system-level context.

Its significance is turning "prompts" from one-off inputs into versioned engineering assets: rules are committed, reviewed, and evolved alongside the code. The two hard rules in TabStationToo—credit PCSX2, and never claim a feature works without testing—are enforced continuously through this mechanism rather than relying on a human to remind the AI each time. This is also the concrete vehicle for what the article calls "putting AI inside a constrained engineering process."

Technical Challenges: From Machine Code to WebAssembly

PCSX2 is fast on PC because it translates PS2 code into native PC machine code—something browsers don't allow. The author used Claude to write an alternative: translate PS2 code into WebAssembly at runtime, comparing it item by item against the original PCSX2 code to ensure identical results.

The graphics renderer was also ported to WebGPU. That was no small amount of work, since PCSX2's rendering pipeline has accumulated a great deal of platform-specific logic, and porting it to WebGPU required redesigning quite a few pieces.

PCSX2's JIT and dynamic recompilation

PCSX2's emulation of the PS2 relies on JIT (Just-In-Time compilation). The PS2's CPU (the Emotion Engine, MIPS architecture) executes MIPS machine code, while PCs are x86 or ARM. PCSX2 uses a "dynamic recompilation" strategy: at runtime, it translates encountered blocks of MIPS instructions into native host machine code on the fly and caches them for repeated execution. This is one to two orders of magnitude faster than interpreting instructions one by one, and it's the prerequisite for PCSX2 running smoothly on PC.

But browser environments forbid generating and executing arbitrary native machine code, so that JIT path is completely blocked. The author chose to translate PS2 code into WebAssembly—still a "compilation" approach, just targeting bytecode executable inside the browser sandbox. The difficulty is that WebAssembly's semantics differ from native machine code: registers, memory model, and instruction granularity all need remapping, and the translated output must be "item-by-item identical" to the original PCSX2 code, or you get incorrect game logic or graphical glitches.

What is WebGPU

WebGPU is a next-generation browser graphics and compute API developed by the W3C GPU for the Web Working Group, and major browsers including Chrome, Edge, Firefox, and Safari have been rolling out support. It replaces WebGL and maps directly to modern graphics backends (Vulkan, Metal, Direct3D 12), offering lower overhead, more flexible resource binding, and compute shader capabilities.

PCSX2's graphics renderer was originally based on the GSdx plugin, which internally makes heavy use of platform-specific Direct3D/OpenGL/Vulkan logic, including texture format conversion, shader generation, and state management. Moving this logic to WebGPU isn't a simple API swap: WebGPU requires pipeline states to be created upfront, bind group layouts to be explicitly declared, and shaders to be written in WGSL—many operations that are "just natural" in native graphics APIs have to be redesigned in WebGPU. That's why the author says the work was "no small amount."

Getting the Emulator to Run Smoothly in a Tab

Optimization took up the most time. For every optimization idea, the author required Claude to check whether the image remained pixel-identical and to log every attempt—including the many that were ultimately abandoned. This discipline of "pixel-identical + complete logs" makes the optimization process traceable and prevents sacrificing correctness for speed.

Testing covered Guitar Hero, GTA San Andreas, Final Fantasy XII, Dragon Ball Z: Budokai Tenkaichi 3, Naruto Shippuden: Ultimate Ninja Storm 5, and Resident Evil 4. The main test machines were an M1 Max Mac and a Linux system with a Ryzen 7 7840U. The author says many games now run close to full speed, but the heaviest scenes are still slow.

Why pixel-identical output is the safety net for optimization

The biggest risk in emulator optimization is that "it looks faster, but some visuals quietly changed": misplaced textures, texture filtering deviations, different frame blending order—issues that often only surface in specific scenes or specific games and are hard to catch by eyeballing. Requiring the image to be pixel-identical to the baseline after every optimization is effectively an automated regression test for each change—any pixel difference means the optimization altered rendering semantics and needs to be reverted or redesigned.

Combined with "logging every attempt (including abandoned ones)," this discipline also solves a hidden problem in AI collaboration: AI tends to keep proposing ideas that have failed before. A complete attempt log makes rejected approaches documentable, preventing repeated stumbles into the same pit and letting newcomers see which optimization directions have already been disproven.

Privacy and Independence

All files stay on the user's computer and are never uploaded. Games are read directly from the user's own disc images. The project is independent of Sony and the PCSX2 team, and the author specifically stresses that TabStationToo bugs should not be reported to PCSX2. The project is still in an early experimental stage, and the author is collecting feedback on which games work.

Lessons for AI-Assisted Development

TabStationToo demonstrates a development paradigm that is taking shape: AI handles large amounts of coding, while humans handle architectural decisions, test verification, and rule-setting. The hard part isn't getting AI to write code—it's establishing a process that makes AI-written code trustworthy. Rule files, automated tests, pixel comparison, and attempt logs are all key to turning "code written by AI" into "usable software."

For developers who want to try a similar path, the lesson from this project is straightforward: giving AI clear boundaries and verification methods is more useful than giving it longer prompts.

One-line Summary

TabStationToo: a browser-based PS2 emulator built on the PCSX2 core, with code mostly written by Claude.

Paragraph Summary

TabStationToo is an experimental project that brings a PS2 emulator into a browser tab, rebuilt from the PCSX2 (GPL-3.0) core with a new frontend, letting users load their own BIOS and disc images to play. What's most unusual is how it was built: most of the code was written by Claude Opus 5.5, while humans handled decisions, testing, and rule-setting; the repo's CLAUDE.md/AGENTS.md imposes hard constraints on the AI, such as crediting PCSX2 and never claiming a feature works without testing. Technically, it replaces native JIT with WebAssembly to translate PS2 code and ports the renderer to WebGPU. Each optimization must be pixel-identical and every attempt is logged. Several games run near full speed, though the heaviest scenes remain slow, and all files are processed locally.

#TabStationToo#PS2 emulator browser#PCSX2 WebAssembly#WebGPU emulator#Claude AI coding
Share:

Related articles