How to make a game with Claude
You can have a playable game in about ten minutes. Here is the whole process, with the prompt to copy, and nothing else in the way.
Jump to a section
Open Claude Code, paste the prompt below, and play the file it writes. Then tell it the one thing that is wrong, and repeat. That is the entire process, and the first playable version takes about ten minutes.
Claude Code, or the chat window at claude.ai if you do not have it. A web browser. Ten minutes. You do not need to know how to code, and you do not need to install a game engine.
Four steps to your first game#
Make a new folder, open a terminal in it, and start Claude Code. If you do not have it, open claude.ai instead. Everything below works the same, you just save the file yourself.
One message. Claude writes the whole game into a single file called game.html.
Double click game.html, or ask Claude to open it for you. Play properly and lose on purpose. Most faults only show up at the moment you die.
Not ten things. One. The ship goes off the left edge and never comes back. Claude fixes it, you play again, you name the next one. Eight to fifteen rounds of that is a finished game.
Build a complete browser game as ONE self-contained .html file.
No frameworks, no build step, no images, no external files.
GAME: The player moves a small ship left and right along the bottom.
Rocks fall from the top. Dodge the rocks and collect the fuel cells.
LOSE: Three lives. Then a game over screen showing the score, the best
score, and a Play Again button.
CONTROLS: Arrow keys, or A and D. On a phone, drag anywhere to move.
HARDER: Rocks fall 10% faster every 15 seconds.
ART: Canvas shapes and colour only. No image files.
SAVE: Best score in localStorage.
TECHNICAL, all three of these matter:
- Use requestAnimationFrame with delta time in seconds, clamped to 0.05,
so the game runs at the same speed on every screen.
- Add this CSS: canvas { touch-action: none; }
- Put every tunable number in one CONFIG object at the top of the script.
Save it as game.html, open it in a browser, play it, and fix anything
that does not work.
Swap the GAME and LOSE lines for your own idea and leave the rest alone. The three technical lines are the difference between a game that works everywhere and one that runs at double speed on a phone and ignores touch.
That is it. If you only read this far, you have enough to build something today.
Then fix one thing at a time#
The first version always runs and never feels finished. Getting from one to the other is the same short loop, repeated.
- Paste the error, do not describe it. Copy the red text from the browser console straight into Claude. It usually gets fixed on the spot.
- Screenshot anything visual. Press Win + Shift + S, or Cmd + Ctrl + Shift + 4 on a Mac, then Ctrl + V into the chat exactly as you would paste text.
- Ask for the changed function, not the whole file. Faster to read, and the rest of the game cannot pick up changes you did not ask for.
- Keep a copy whenever it improves. Ask Claude to commit, or save game-02.html yourself. A bad round then costs one step.
The faults that show up in almost every first build, and a ready prompt to fix each one, are in the prompt guide.
Put it online in one command#
A single HTML file is already a finished thing. You can email it, or put it on Agent Games where people are looking for exactly this. Connect the publishing server once and Claude Code can publish for you, filling in the model, the prompt and the token count from what it just did.
claude mcp add --transport http agent-games https://agentgames.dev/mcp \
--header "Authorization: Bearer YOUR_KEY"
If you would rather not handle a key, sign in and open the publish with an agent page from your account. It shows a single line you paste into Claude Code, and the agent pairs itself with your account. The reference is in the agent docs.
Which Claude model should you pick?#
Use Opus 5.5. It is the default for coding work and it is what you get in Claude Code unless you change it. The others are worth knowing about, and that is the whole decision.
| Model | Use it for | Price per million tokens |
|---|---|---|
| Claude Opus 5.5 | The default. Building the game and fixing it. | $4 in, $20 out |
| Claude Sonnet 5 | Small, well described changes once it works. | $2 in, $10 out |
| Claude Fable 5.1 | A bug Opus has failed to fix twice. | $10 in, $50 out |
| Claude Haiku 4.5 | Bulk mechanical edits. Not a first builder. | $1 in, $5 out |
Anthropic list prices, checked 23 September 2026. If you build inside a Claude subscription rather than through the API, none of this is metered and you can ignore the column.
What a finished game really takes#
Ten minutes gets you something playable. A game people finish takes a lot more, and every game on Agent Games publishes what it took.
An Opus 5 game here averaged 4.2 million tokens and over eight hours of build time. A Fable 5.1 game averaged 10.4 million and nearly fourteen hours. Those builds predate Opus 5.5, so treat them as the shape of the work rather than as a benchmark.
Nobody here built the same game twice with two models, so none of this says which model is better. It says what people reached for. Creators report their own token counts, so read them as honest approximations.
🧠Games on this site written by Claude
Each page lists the exact model, the prompt and the tokens the build took.Common questions#
Do I need to know how to code to make a game with Claude?
No. You describe the game, Claude writes the file, and you open it in a browser. You do need to read an error message and describe what looks wrong, because Claude cannot play the result. That is an afternoon of learning, not a career.
Which Claude model is best for making games?
Claude Opus 5.5. It is Anthropic's recommended default for coding and long agentic work, and it is what Claude Code uses. Drop to Sonnet 5 for small fixes once the game works, and reach for Fable 5.1 only for a bug Opus has failed at twice.
How long does it take to make a game with Claude?
About ten minutes to something playable. The finished games on this site averaged over eight hours of build time, spread across several sessions, with the biggest at nineteen and twenty nine hours. The first ten minutes are the least representative part.
Do I need Claude Code, or is the chat window enough?
The chat window is enough to finish a game. Claude Code is worth it once copying console errors back and forth annoys you, because it runs the file and reads its own errors. It can also publish the finished game without you opening a browser.
How many tokens does a Claude built game use?
Across 25 games here, an Opus 5 game averaged 4.2 million tokens and a Fable 5.1 game 10.4 million. Two quick Sonnet 5 builds used about 28,500 each. Creators report these figures themselves when they publish.
Can I keep the rights to a game Claude wrote?
Yes. Publishing here does not transfer ownership. The game gets its own page recording the model, the prompt and the token count, anyone can play it without an account, and the file is yours to put anywhere else too.
Where to go next#
For ten more prompts you can send as they are, plus a repair prompt for every common fault, use the prompt guide. For the method behind all of this, including how to write a brief before you write a prompt, read how to make a game with AI.
To see what other people's Claude runs produced, the made with pages list every game by the model that wrote it, with the prompt behind each one. When yours is worth playing, publish it.
Built something? Put it on Agent Games.
Publishing takes a file and a minute. Your game gets its own page listing the model, the prompt and the token count, and anyone can play it without signing up.
Read next