Making a game with a coding agent
A coding agent on your own computer writes the game. Pocket Studio gives it the pocket-studio command, which creates the project, compiles it with the PocketJS compiler, shows the agent pictures of the game and sends each build to the device in your room. The agent is Claude Code or Codex.
#Set up your computer, once
Click the Claude Code or the Codex figure on the workbench. Its card has two steps.
1. Run the command in a terminal.
curl -fsSL https://studio.pocket.nexus/install | sh -s -- claude
Use codex in place of claude for Codex. The command:
- needs
curlandtar, and the agent's own command (claudeorcodex) onPATH; - finds Bun, or installs it with Bun's own installer into
~/.bun; - downloads the Pocket Studio kit (the command, the starter games, the plugin and the PocketJS compiler) and copies it into
~/.pocket-studio; - puts a
pocket-studiocommand on yourPATH: in Bun's directory when that is inside your home directory, else in~/.local/binor~/bin. It edits no shell profile. When the directory is not onPATH, it says so:Add ~/.local/bin to PATH to run it as pocket-studio.; - installs the Pocket Studio plugin into the agent with the agent's own plugin commands.
2. Paste the prompt into a new agent session. The card writes it for the device you chose, with a link code:
Make me a Pocket Studio game for the PSP. Link code: K7QD-9M4X. The game: <describe your game>
Replace <describe your game> with what the game is, then send it. The link code connects the agent to your room once, within 15 minutes.
#What the agent does
The plugin's skill tells the agent the steps. In a project it runs:
pocket-studio link <CODE>: links your computer to your account.pocket-studio new --device psp --title "Moon Lander" --agent claude: copies a working starter game into./moon-lander/, opens a session in your room and sends the first build to the device.pocket-studio title "Moon Lander" --tagline "…": names the game on your shelf at once.- It reads the project's
AGENTS.md, then writes the game. pocket-studio shot --do "<steps>": runs the game on your computer with no screen and writes a picture of each state, which the agent reads.pocket-studio push: compiles the game and sends the build. The room starts it on the device a few seconds later and saysBuild 2 of Moon Lander is on the PSP.
It then tells you how to play and asks you how the game plays. It publishes only when you ask.
#Start from the room
Make a new game on a device's card, or New game on the workbench, writes a command with a pairing code:
pocket-studio create PINE-QWJ6
Run it in a terminal on a computer that is set up. It links the computer, creates the project from a starter, sends the first build, and starts the first coding agent it finds on PATH in the project. --agent codex picks the agent, --agent none starts none, and --no-launch creates the project without starting the agent. A command is good for 15 minutes and works once; Get a new command writes another.
pocket-studio continue in a project starts the agent there again.
#The project
| File | Holds |
|---|---|
game.ts | The rules, as plain functions over one Game object. |
app.tsx | Every screen and the frame loop. |
layout.ts | One layout for each screen shape. |
kit.tsx | Device facts, controls and touch buttons. |
main.tsx | Mounts the app. |
pocket.json | The app manifest: id, capabilities, one viewport for each device family. |
studio.json | The game's card: title, tagline, cover colours. |
AGENTS.md | The guide to the project for the agent. CLAUDE.md points at it. |
.pocket-studio.json | The session and its token. Keep it to yourself: never commit or share it. |
A new project starts from one of the starter games, Snack Snake, Twenty48 or Boxel. .pocket-studio.json and .pocket/ (builds and pictures) are added to the project's .gitignore.
A game is a TypeScript program for PocketJS: JSX builds a tree of views once, signals update single nodes, and a Rust core lays out and draws it 60 times a second. The project has no package.json; the compiler supplies @pocketjs/framework and solid-js.
#Devices
| Device | --device | Screen in logical pixels | Input |
|---|---|---|---|
| PSP | psp | 480 × 272 | Buttons |
| PS Vita | vita | 480 × 272 | Buttons and touch |
| Nintendo 3DS | 3ds | 400 × 240, and 320 × 240 below | Buttons, touch on the lower screen |
| iPod touch | ipod-touch | 320 × 480 | Touch |
| Android phone | android | 360 × 640 | Touch |
A project is linked to one device at a time. pocket-studio new --device <id> --dir . inside the project gives the game a session on another device and keeps its files.
#Working by hand
You can run the same commands yourself. pocket-studio dev rebuilds and sends the game on every change you save, until you stop it with Ctrl-C. pocket-studio status prints the session's phase and build. The CLI reference lists every command.
#Two ways of making
The workbench offers two ways. Pro is this one: a coding agent on your computer, for games of any size. Casual, where Pocket Studio's own AI makes a small game in the page, is coming.