The most common way to fail at “making a game with AI” in 2026 is not picking a weak model—it is opening Unity, Godot, and Unreal comparison threads on day one while you still do not have a window that moves when you press Space. Claude Code is a terminal coding agent: it edits files, runs commands, and reads stack traces. Using it for game development is not about asking for a AAA title in one shot; it is about locking a stack that runs on your machine, then filling in the game loop, input, and collisions in small steps. This guide walks from Node and Claude Code installation through two zero-prerequisite paths—pygame and HTML5 Canvas. The acceptance bar is simple: someone else can start the game from your README and play the core loop for at least one minute.
Why you talk about the stack before you talk about AI
The old pattern is to describe “a game like X” to a chat bot and paste a wall of code that never runs. The better pattern treats the repo as real engineering: a main.py or index.html, a fixed frame-rate loop, and git history. Claude Code can repeat “change one file → run → read the traceback → change again” only inside that kind of project. The friction is rarely model IQ; it is execution boundaries—which checkout the agent edits, where commands actually run, and whether you can roll back when a rewrite goes wrong.
Games add noise: art, audio, physics, and level data are messier than typical CRUD. If you are starting from zero, shrink scope to one rectangle, one velocity vector, one score. A 2D platformer or breakout clone is enough to learn the collaboration rhythm; 3D, multiplayer, and Steam launch are later bills. When you eventually need iOS or Unity mobile export, the toolchain expects macOS—plan for a remote Mac rental instead of hunting for Xcode on Linux.
Split “small game stacks” into three buckets first
Classify by runtime, rendering, and distribution—not by hype rankings. Bucket one is script plus desktop window (Python pygame, Love2D). Bucket two is browser Canvas or WebGL (plain Canvas, Phaser, Pixi). Bucket three is engine editors (Godot, Unity, Unreal). Claude Code fits buckets one and two best because the project is mostly text files with clear diffs. Bucket three means learning editor buttons first; agents often fight .import folders and huge Library trees.
| Stack | Entry | Execution | Context | Best for |
|---|---|---|---|---|
| pygame | Terminal + local window | python main.py for instant feedback | Small repo of .py files | Beginners who want a window today |
| HTML5 Canvas | Browser + static server | Refresh to preview; easy share links | index.html + game.js | Front-end comfort or link-based playtests |
| Godot 4 | Editor + GDScript | Scene tree and asset import | .tscn + scripts | Learners who accept node concepts |
| Unity | Editor + C# | Components, Asset Store | Large Library folder | C# background, 3D or multi-platform goals |
| Claude Code CLI | Project root in terminal | Edit files; run tests and build commands | The git workspace you opened | Collaboration layer on any stack |
This article assumes Windows, macOS, or Linux on your dev machine. pygame needs Python 3.10 or newer. The HTML5 path uses Node only to serve static files locally—not to compile the game into a Node server.
The collaboration entry point matters more than the model name
Model benchmarks are not the dividing line. Who holds a runnable checkout is. Cursor edits inside an IDE; Claude Code runs commands in the terminal with your approval. Both can write a loop, but if run commands exist only as descriptions in chat, you still die on ImportError.
| Tool | Entry | Execution | Context | Best for |
|---|---|---|---|---|
| Claude Code | CLI / terminal | Edit repo; run python / npm | Git working tree | Step-by-step beginners who want command history |
| Cursor Agent | IDE | Edit files; integrated terminal | Open project | Developers who rely on visual breakpoints |
| Plain chat | Web UI | Usually cannot run your project | Conversation only | Concept questions, not shipping |
| Remote Mac + CLI | SSH | Xcode / iOS Simulator | Apple toolchain projects | Native mobile export |
For CLI trade-offs in depth, see Pi, Claude Code, and Codex compared. To stop re-explaining pygame conventions every session, install an Agent Skill—see the Agent Skills guide.
Pick stack and workflow by scenario
| If you are | Choose | Avoid |
|---|---|---|
| Total beginner; movement today | pygame + this seven-step checklist | Unity 3D template |
| Comfortable with HTML/CSS; share a link | Canvas + npx serve | WebGL shaders on day one |
| Already using Godot | Godot + Claude Code on .gd only | Asking AI to rebuild entire .tscn files |
| Targeting iOS App Store | Remote Mac + native or Unity iOS export | “Simulating” codesign on Windows only |
| Long sessions; laptop lid closes often | VPS + tmux for Claude Code | Killing local processes when the lid shuts |
Recommended zero-prerequisite combo (pygame path)
Operating system: your choice. Python 3.11+ and pip install pygame. Install Node 22 LTS only to set up the Claude Code CLI (follow Anthropic’s current docs: npm install -g @anthropic-ai/claude-code or the official installer). Store API keys in ~/.config/game-dev/anthropic.env with directory mode 700 and file mode 600; add that path to .gitignore.
At the repo root, add GAME.md: five sentences covering controls, fail state, scoring, target frame rate, and what a acceptance screenshot should show. Ask Claude Code to read it before each change so scope does not creep. Fixed run command for pygame: python main.py. For HTML5: npx --yes serve . and open the localhost URL the terminal prints.
main.py; keep 60 FPS; add a player rectangle and left/right movement; do not add dependencies; after edits run python main.py and fix traceback issues until the window opens.
Five mistakes that kill the project
- Unity 3D on day one. Import settings, lighting, and physics presets eat a week; one-shot diffs rarely land cleanly.
- Never letting the agent run commands. Reading generated code without executing it stacks ImportErrors until you cannot tell which file broke.
- One prompt for a “complete game.” Split work: window → input → collisions → score → audio.
- Skipping git commits. When the agent rewrites whole files, you cannot roll back and trust erodes.
- Chasing Xcode on the wrong OS. iOS builds start on macOS; see Mac mini pricing and the help center.
Seven steps from install to a runnable mini-game
- Install Node 22 LTS and git. Run
node -vandgit --version; visible version strings mean you are done. - Install the Claude Code CLI. Complete login or API setup per official docs; keep secrets out of shell history.
- Create a project folder and
git init. Add.gitignore(env,__pycache__), emptyREADME.md, andGAME.md. - Pick pygame or HTML5. pygame: virtualenv and
pip install pygame. HTML5: createindex.html+game.js. - Ask Claude Code for a minimal skeleton. Require runnable output, one or two files, no placeholder TODOs; run the game in-session until errors are gone.
- Iterate gameplay. Add one mechanic per step (collision or score), commit each time; tune constants before rewriting architecture.
- Finish the README. List dependencies, run commands, known bugs; have a friend follow the README—success is your acceptance test.
python3 -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install --upgrade pip pygame python -c "import pygame; print(pygame.ver)"
cd my-first-game git add GAME.md README.md .gitignore git commit -m "chore: bootstrap game spec" claude # after login, ask for main.py and run python main.py in session
npx --yes serve . # open the http://localhost URL shown (port may differ)
FAQ
Can I do this with zero coding experience?
Yes, if you shrink scope to one control scheme, one fail state, and one score. Run the official install and run commands before asking for features.
Claude Code or Cursor for games?
Cursor fits visual editing in an IDE; Claude Code fits stepwise terminal work and tests. For the first runnable build, Claude Code often clarifies files and commands faster.
Do I need Unity?
Not for the first project. Unity suits 3D and heavy asset pipelines. pygame or HTML5 Canvas usually gives a visible result the same day.
The AI code will not run—what now?
Paste the full traceback and limit changes to the files involved. Fix one error, commit, then continue.
When is the mini-game “done”?
Someone else can start it from README; the core loop stays fun for at least 60 seconds; known issues are listed in the repo.
Conclusion
Game dev with Claude Code is about a runnable stack, small commits, and letting the agent execute commands—not one-shot “full AAA” generation. Run the seven-step pygame or HTML5 path first, then consider Godot, Unity, or iOS. When the toolchain demands Xcode, move to a macOS node; everyday 2D practice can stay on the laptop you already own.
Further reading
- How Claude Code, Cursor, and Codex differ in execution →
- Agent Skills for repeating game-dev workflows →
- Long sessions on a VPS with tmux →
When you need Unity iOS or Xcode, use a remote Mac
The pygame and HTML5 paths in this guide run on Windows, macOS, and Linux. iOS export and parts of mobile pipelines still need macOS. Rent a remote Mac instead of debugging on the wrong OS.