To make a game with Claude Code, open an empty folder, start Claude Code, and ask for one small browser game with clear controls, a goal, and a way to lose. Play the file it writes, tell it the single biggest problem, and repeat. When it is fun, add the Fifth Door MCP server and ask Claude Code to publish it, so you get a public play link instead of a file on your laptop.
This guide walks through that loop, the first prompt, how to fix bugs quickly, and how to put the game online.
What do you need before you start?
- Claude Code installed and signed in
- A web browser
- An empty folder for the game
- One small idea (see AI game ideas if you need one)
You do not need a game engine. A browser game made of HTML, CSS, and JavaScript is the fastest thing to build, test, and share.
What should the first prompt say?
Ask for a complete, small game, not a feature list. Cover the controls, the goal, the fail state, and the device:
"Make a browser game in this folder with an index.html at the root. It is a one-screen arcade game where the player moves a paddle left and right to catch falling fruit and avoid bombs. Arrow keys on desktop, drag on touch screens. Three lives. Score goes up per fruit, and fruit falls faster every 15 seconds. Show score and lives at the top, a game over screen, and a restart button. Keep all tunable numbers (speeds, spawn rate) in one config object near the top."
Two details in that prompt pay off later:
index.htmlat the root. That is what most hosts, including Fifth Door, expect.- A config object. You can ask "make it 20 percent slower" and Claude Code changes one number instead of rewriting logic.
For more prompt structure, see best prompts for an AI game generator.
How do you iterate without breaking the game?
The loop is simple: play, name one problem, fix, play again.
- One change per message. "The bombs are too hard to see" beats a list of ten complaints.
- Lose on purpose. Most bugs show up at game over and restart.
- Paste errors, do not describe them. Copy the red text from the browser console into Claude Code.
- Use version control. Ask Claude Code to commit each time the game gets better, so a bad change costs one step.
- Test on a phone early. Touch controls and screen size are where browser games usually break.
Eight to fifteen rounds of this usually gets a small game from rough to fun.
How do you add art and sound?
You can ask Claude Code to draw shapes and generate simple tones in code, which is fine for a prototype. If you add the Fifth Door MCP server, Claude Code also gets tools that generate game assets into the project's assets/ folder:
- Single images (props, icons, backgrounds, tileable textures)
- Characters drawn from every facing, plus animations such as walk, run, jump, and idle
- Matched sets, like card faces or tiles
- Looping background music, sound effects, and voice lines
Asset generation runs on a daily budget per account. Ask for one style reference first and pass it to every later asset so the art matches.
How do you put a Claude Code game online?
Install the Fifth Door MCP server:
claude mcp add fifth-door -- npx -y @fifth-door/mcp@latest
Then:
- Ask Claude Code to run
login. Approve the short code in a browser where you are signed in to Fifth Door. This happens once per computer. - Ask it to publish. It calls
publish_gamewith a slug, a play target (mobile,mobile_landscape,desktop, oreverywhere), and a cover image. - Open the play URL it returns on your phone.
New games are unlisted, so only people with the link can find them. When it is ready, ask Claude Code to make the game public so it shows up on Discover. Publishing the same slug again updates the game and keeps the URL.
The full walkthrough, including Cursor and Codex, is in how to publish a vibe-coded game.
One thing to know before you add saves
Games on Fifth Door run in a sandboxed frame where localStorage and cookies are not available. If Claude Code wrote save logic with localStorage, it will work on your laptop and fail once published. The Fifth Door Platform SDK provides saved progress, leaderboards, multiplayer rooms, and daily puzzles instead. The MCP server can read the SDK docs without signing in, so ask Claude Code to read them before it adds any of those features.
Common mistakes
- Asking for a big game in the first message
- Fixing several things at once, so you cannot tell what broke
- Never testing on a phone
- Saving progress to
localStoragein a game you plan to publish - Keeping the game on your laptop where nobody can play it
FAQ
Can I make a game with Claude Code if I cannot code?
Yes. You describe the game and the problems you see, and Claude Code writes and edits the code. Reading the code is optional.
What kind of game should I make first with Claude Code?
A one-screen browser game with one control and a clear fail state: a catcher, a dodger, a tap runner, or a memory match.
Should I use a game engine with Claude Code?
Not for a first game. Plain HTML and JavaScript are faster to test and publish. Engines make sense for larger projects; see AI game maker vs game engine.
How do I share a game made with Claude Code?
Publish it to a host that gives you a public link. With the Fifth Door MCP server, Claude Code publishes it for you and returns a play URL.
Do I have to use Claude Code?
No. The same loop works in Cursor or Codex, and if you would rather not use a coding agent at all, use Fifth Door create and describe the game in plain language.
Make one tonight
Open an empty folder, start Claude Code, paste the prompt above, and play the result. Once it is fun, install the Fifth Door MCP server, publish it unlisted, test it on your phone, then make it public on Discover.