VIBE CODING · GUIDE
Three.js Games.
How to build a browser-based 3D video game with Claude Opus 5 and the Claude Code desktop app — no coding required, just one well-written prompt and Three.js, the setup behind the viral AI-built games on X.
01
Why everyone is building games
On 24 July 2026, Anthropic released Claude Opus 5 — and within days, X filled up with browser games that one person built from a single prompt. The post that set the tone came from Matt Shumer: "Claude Opus 5 one-shotted this game. EVERYTHING you see in this demo is custom code... not a single external asset was used." He followed it with Claude-of-Duty — a full first-person shooter in the browser, roughly 55,000 lines of code, where every texture, mesh, animation, and sound is generated by code at load time. No art files at all.
The interesting part isn't that AI wrote code — it's that the whole package now fits inside one app. You describe a game, Claude builds it, runs it, opens it in a browser next to your chat, plays it, and fixes what feels broken. That loop used to require a programmer. Now it requires a paragraph.
02
What is Three.js?
Three.js is a free, open-source JavaScript library that makes 3D graphics work in an ordinary web browser. Under the hood it drives WebGL — the technology that lets a browser talk directly to your computer's graphics chip — but it wraps all of that in friendlier ideas: scenes, cameras, lights, materials, and objects. It has powered browser games, product configurators, and award-winning websites for over a decade.
Two reasons it's the engine behind this wave of AI-built games. First, games made with it run anywhere — no download, no install, no app store. You share a link and anyone on a laptop or phone can play. Second, Three.js has more than a decade of open documentation and examples online, which means Claude knows it deeply. When you ask for "glowing neon edges" or "camera shake on impact," Claude has seen thousands of working examples of exactly that.
You never need to learn it yourself. It's simply the material Claude builds with — the way you don't need to understand ovens to order a pizza.
03
What you need
- The Claude Code desktop app — free to download for macOS, Windows, and Linux (beta) from the Claude Code docs.
- A paid Claude plan — Claude Pro works, but game builds are long sessions that chew through usage; Claude Max is the comfortable option, and it makes Opus 5 the default model.
- An hour — the first build takes minutes; the fun is in the iterating afterwards.
That's the whole list. You don't need a game engine, a graphics program, or any developer tools — and where a build does need something technical under the hood, Claude installs and configures it itself as part of the job.
04
Set up Claude Code
Four steps, none of them technical:
- 1. Install and sign in. Download the desktop app, open it, and sign in with your Claude account.
- 2. Create a folder for your game. Make an empty folder somewhere sensible — say
my-first-game— and open it in the app's Code tab. This folder is where all the game files will live. - 3. Pick the model. In the model picker in the chat composer, choose Claude Opus 5. This is the model behind the viral demos — the one that can hold an entire game in its head at once.
- 4. Open the Browser pane. Press Cmd+Shift+B (macOS) or Ctrl+Shift+B(Windows) so you can watch the game come alive next to the chat. Claude opens it automatically anyway, but it's nicer to have it up front.
05
The prompt
Here's a starter prompt in the same spirit as the viral games — everything generated from code, no downloaded assets, and Claude told to play-test its own work. Copy it as-is, or swap the game idea for your own:
Build me a complete browser-based 3D game using Three.js.
The game: a neon hovercraft racer. I pilot a hovercraft through a
procedurally generated canyon at night, dodging obstacles and
collecting energy orbs to keep my boost meter full. The longer I
survive, the faster it gets.
Requirements:
- Everything is generated in code — no downloaded models, textures,
images, or audio files. Build every shape, material, and sound
procedurally.
- Controls: A/D or arrow keys to steer, W or up to boost, with a
short tutorial overlay on first load.
- A proper game loop: start screen, playing state, game over screen
with my score and a one-key restart.
- A HUD showing speed, score, and boost meter.
- Sound effects and a simple synthwave music loop using the Web
Audio API.
- Make it feel great: camera shake on collisions, particle trails,
glowing bloom on the neon edges, smooth difficulty ramp.
Set up the project, run it locally, open it in the browser, and
play-test it yourself. Fix anything that feels broken or boring
before you tell me it's done.Why this prompt works — steal these habits for your own:
- A vivid one-line concept."Neon hovercraft racer through a canyon at night" gives Claude an art direction, not just a mechanic.
- "No external assets." This is the trick behind the viral demos. Downloaded 3D models and audio files are where things break; code-generated everything means the game just works.
- A complete game, not a demo. Asking for a start screen, game over, restart, and HUD is the difference between a tech demo and something your friends will actually play.
- "Play-test it yourself." In the desktop app, Claude genuinely can — it opens the game in the Browser pane, presses the keys, watches what happens, and fixes issues before handing it over.
06
Watch it build, then play
Hit enter and let it run. Claude will set up the project, write the game across several files, start a local server, and open the game in the Browser pane. A build like the starter prompt typically takes several minutes — this is a good moment to get coffee rather than interrupt.
When Claude says it's done, the game is already running in the Browser pane. Click into it and play. It's a real browser, so the game behaves exactly as it will for anyone you share it with.
Expect the first version to be about 80% right — impressive, playable, and slightly off in ways you'll feel immediately: too fast, too floaty, too dark. That's not failure; that's your starting point as the game's designer.
07
Make it yours
This is where it becomes a video game you made rather than one you generated. Play for two minutes, notice the thing that bothers you most, and describe it in plain English — feelings are fine, Claude translates them into physics and code:
"The steering feels too slippery — make it tighter and more arcade-like."
"Add a drift mechanic on the S key that builds extra boost."
"The canyon all looks the same. Add three visual zones that change
as my score climbs — ice, lava, and a glitchy digital zone."
"Add a local high-score table that persists between sessions."
"Make the game-over screen more dramatic — slow motion, camera pull-back,
shattering effect on the hovercraft."One change per message works best. Each time, Claude edits the code, reloads the preview, and you play again — a designer-and-engineer loop where you only ever do the designer half.
08
Tips for better games
A few things that separate the demos people scroll past from the ones they share:
- Ask for "juice." Screen shake, particles, sound on every action, hit-pauses, glow. Game designers call this juice, Claude knows the term, and it's most of the difference between flat and fun.
- Steal structure, not games."Like Temple Run but you're a paper plane in a thunderstorm" gives Claude proven mechanics plus a fresh identity.
- Tune difficulty last. Get the feel right first, then ask Claude to make the first thirty seconds easy and the ramp gradual — most first builds are too hard.
- Test on a phone. Ask for touch controls and a mobile layout — most people who click your link will be on a phone.
- Ship it. When you're proud of it, ask Claude to deploy the game to a free host like Vercel or GitHub Pages. You'll get a link anyone can play — which is the whole point.
One-shotting — the party trick
One massive prompt, one complete game, no edits.
Great for demos and X posts — this is what "one-shotted" means in the viral clips.
Iterating — the real workflow
A solid starter prompt, then dozens of small taste-driven changes.
How games actually get good. Your taste is the input the model can't generate.
09
Sources
- [1]Matt Shumer on X — “Claude Opus 5 one-shotted this game”
- [2]Claude-of-Duty — an FPS in Three.js, built from a single prompt
- [3]TechCrunch — Anthropic launches Opus 5
- [4]Claude Code docs — Desktop application
- [5]Claude Code docs — Get started with the desktop app
- [6]Three.js — official site and examples
