# How to publish a game made with Claude Code

> A step-by-step checklist for turning a local Claude Code game prototype into a live playable build—bundling assets, fixing paths, and choosing where to deploy.

Published: 2026-11-21 · Updated: 2026-12-01 · Canonical: https://pita.sh/blog/publish-a-game-made-with-claude-code

Publishing a game made with Claude Code comes down to four steps: verifying a clean production build locally, checking asset paths and browser headers, deciding how you will store large binaries, and deploying to a host that fits your game's size and backend needs.

## 1. Make sure the production build runs cleanly locally

Dev servers like `vite` or `webpack-dev-server` hide problems that show up once bundled. Before publishing anywhere, have Claude Code run a production build and preview it locally:

```sh
npm run build
npm run preview
```

Check the browser console for:
- **Broken asset URLs:** Files referenced by string path (like `new Audio('/sfx/jump.ogg')` or `loader.load('/models/ship.glb')`) must live in `public/` (or be imported so the bundler rewrites their paths).
- **Case-sensitive filenames:** macOS and Windows filesystems are usually case-insensitive, while Linux web hosts are case-sensitive. `Hero.png` vs `hero.png` works locally and 404s online.
- **Hardcoded `localhost` API or WebSocket URLs:** If your game talks to a backend, read the endpoint from `window.location` or an environment variable rather than `ws://localhost:3000`.

## 2. Keep binary assets manageable

If your game is mostly procedural canvas or small pixel art, everything fits inside a normal Git repo. Once you add `.glb` 3D models, `.ogg`/`.wav` tracks, or high-res sprite sheets, pushing binaries into Git slows clones and can trip GitHub's 100 MB file limit.

For small projects, compress textures to `.webp` and audio to `.ogg`/`.mp3` early. For larger projects, separate heavy binaries from Git history using an object bucket or a content-addressed manifest like `assets.lock` (see [How to manage large game assets without Git LFS](/blog/why-git-lfs-breaks-game-repos)).

## 3. Pick a publishing target that matches the game

- **Small static browser game, public release:** **itch.io** is great if you want a storefront page and community discovery; **Cloudflare Pages** or **GitHub Pages** work well if you just want a clean URL on your own domain.
- **Frequent playtest iterations with Claude Code:** If you want Claude Code itself to push builds, spin up separate `playtest` environments, and roll back bad updates without you manually zipping files, [Pita](/) connects directly to Claude Code via its account MCP server (`https://api.pita.sh/mcp`) or a per-game agent link and CLI (`pita publish --to production`). Free ($0 forever) covers 1 static web game with private git and `assets.lock`; Basic ($14/mo, 7-day free trial) adds up to 5 games, 10 playtest environments per game, collaborators, and WASM/JS multiplayer servers with SQLite.
- **Desktop release (Windows / macOS / Linux):** Wrap your web build with Tauri or Electron (or export natively if you're using Godot/Bevy) and distribute via itch.io or Steam.

## 4. Automating the deploy loop from Claude Code

If you deploy to a static host, ask Claude Code to add a `deploy` script to `package.json` (for example using `wrangler pages deploy dist` for Cloudflare Pages or `butler push dist/ user/game:html5` for itch.io) so updates take one command instead of manual uploads.

If you use Pita, connect Claude Code once with `claude mcp add --transport http pita https://api.pita.sh/mcp` (or paste a per-game agent link). From there, you can ask it to create a game, publish builds, spin up isolated environments (`pita publish --to playtest --create`), or roll back to a previous build directly from the session.

## FAQ

### Can Claude Code publish to itch.io automatically?
Yes, if you install itch.io's `butler` CLI locally and authenticate it once (`butler login`). Claude Code can then run `npm run build && butler push dist yourname/yourgame:html5`.

### What is the easiest way to publish if my game also has a multiplayer server?
Static hosts like GitHub Pages, Cloudflare Pages, and itch.io cannot run persistent WebSocket or UDP game servers. You can host a custom server separately on a container host (like Fly.io or Railway) and point your client at it, or deploy both your client and a sandboxed JS/WASM server with built-in SQLite together on Pita.
