Skip to content
Browse documentation

Make a browser game with Claude Code

Set up a SpawnKit game in Claude Code, give the agent project context, make a playable change, and verify the production build.

View Markdown
On this page

1. Start with a standalone game

Download a kit from the starter builder and extract it into a new folder, such as my-game. Install Node.js 24 or newer and pnpm 12. Open the folder containing package.json, src/, and AGENTS.md. Local development needs no SpawnKit account. Follow tool installation and version checks if Node or pnpm is missing. Paste shell commands into a terminal opened in the game folder.

Run inside the extracted game folder
pnpm install
pnpm dev

Open the address printed in the terminal and check the starter scene works. This gives you a working version to compare against. Keep that terminal running while the agent edits; open a second terminal in the same game folder for checks. CLI creation is an alternative to downloading the kit.

2. Open the game in Claude Code

Install Claude Code using its official quickstart. In a terminal, change into the extracted game folder and run claude. Complete the sign-in flow if prompted. The session should show your game folder as its working directory.

See the official Claude Code setup guide for installation and sign-in. Your agent account is separate from a SpawnKit hosting account.

If the agent cannot reach the package registry or write to the package cache, run pnpm install in your own terminal inside the game folder, then ask it to continue. This also applies to access-denied errors for pnpm-store-operation-locks. Keep pnpm and the existing lockfile; switching package managers does not fix an agent's permissions. If browser tests need Chromium, run pnpm test:setup in that terminal too.

If the agent cannot open a documentation URL, open the guide in your browser and use Copy as Markdown to share it. Keep network and sandbox protections enabled; report blocked steps separately from completed checks.

Keep the generated AGENTS.md. If your Claude Code setup uses CLAUDE.md instead, add an @AGENTS.md import to CLAUDE.md without overwriting existing instructions. Run /context to inspect loaded memory files. Instruction loading can depend on your Claude Code version and settings.

See the official project-instruction documentation for details.

3. Give the agent the right context

First task to paste into your agent
Read AGENTS.md, README.md, and package.json in this game folder.
Explain how to run the game and which engine it uses.
Change collectible scoring from one point to five points.
Keep the existing engine, controls, and project structure.
Update the relevant tests, run the available checks, and report results.
Show me what changed and how to verify the score in the game.

Ask it to read AGENTS.md, README.md, and package.json, identify the selected engine, and explain where input, simulation, rendering, and score updates live. Share the project structure guide when it needs orientation. It should use the existing game scripts and preserve your engine and local configuration.

Describe one concrete change, such as awarding five points per collectible. State what the player should see, which behavior must stay the same, and how you will check it. Ask for a focused change and a summary of affected files. Do not ask the agent to regenerate over an existing game.

4. Review and play the change

Inside the game folder
pnpm lint
pnpm build
pnpm preview

Run pnpm test too if the game includes that script. Ask the agent to report which checks actually ran and their results. Open preview yourself and verify the change in gameplay; a passing build does not prove the controls or scoring work.

Review the changed files in your editor and ask the agent to explain anything unclear. Save a Git commit, or stop the development server and copy the project to a separate backup folder before the next feature. Keep changes inside this game folder.

5. Share the finished game

Build again after your final edits. Follow Publish your game to upload the contents of dist, or Upload an existing game for a different browser export. Browser upload creates a new project. For an already-hosted game, follow Publishing an update instead. Verify the live game after deployment.

Need a hand? Get support

Explore the guides

Build your first game

Download a standalone game kit, run it locally, and make your first change.

Create and build a game with @spawnkit/cli

Start in a parent folder, generate your game, then run every development command inside the new game folder.

Upload an existing browser game

Upload a self-contained browser build. Your original source, engine, and build tools can stay as they are.

Publish your game

The dashboard accepts a ZIP of your built game. You will need an account to deploy it.

Use the SpawnKit dashboard

The dashboard manages your hosted games. Your editor or AI agent remains where you change and build your game source.

Make a browser game with Codex

Use Codex with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Claude Code

Use Claude Code with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Make a browser game with Cursor

Use Cursor with a standalone TypeScript game kit. Start with a working scene and improve it one playable change at a time.

Extend your game

Find the right files, make a focused change, and check it in a playable build.

A complete publishing example

Follow a small example from editable source to a ZIP with index.html at its root. Use your own game title, description, and artwork.

Add tools to an existing game

Keep a recoverable baseline, inspect the proposed changes, and verify one addition at a time.

Test and debug your game

Combine automated checks with a short playthrough of the production build. A successful build alone does not verify gameplay.

Project structure and configuration

Your downloaded kit is a standalone TypeScript project. Its files belong to you and do not depend on the SpawnKit repository.

SpawnKit CLI reference

A command-by-command reference to the implemented CLI. Local generation works without an account; hosted operations require access to a project.

Accounts and access

Building locally is account-free. Publishing requires an account with access to the target project.

Agents and API resources

Public discovery endpoints are account-free. Use the dashboard or @spawnkit/cli for publishing.

16 guides available