Pocket Studio Docs

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 curl and tar, and the agent's own command (claude or codex) on PATH;
  • 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-studio command on your PATH: in Bun's directory when that is inside your home directory, else in ~/.local/bin or ~/bin. It edits no shell profile. When the directory is not on PATH, 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:

  1. pocket-studio link <CODE>: links your computer to your account.
  2. 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.
  3. pocket-studio title "Moon Lander" --tagline "…": names the game on your shelf at once.
  4. It reads the project's AGENTS.md, then writes the game.
  5. 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.
  6. pocket-studio push: compiles the game and sends the build. The room starts it on the device a few seconds later and says Build 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

FileHolds
game.tsThe rules, as plain functions over one Game object.
app.tsxEvery screen and the frame loop.
layout.tsOne layout for each screen shape.
kit.tsxDevice facts, controls and touch buttons.
main.tsxMounts the app.
pocket.jsonThe app manifest: id, capabilities, one viewport for each device family.
studio.jsonThe game's card: title, tagline, cover colours.
AGENTS.mdThe guide to the project for the agent. CLAUDE.md points at it.
.pocket-studio.jsonThe 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--deviceScreen in logical pixelsInput
PSPpsp480 × 272Buttons
PS Vitavita480 × 272Buttons and touch
Nintendo 3DS3ds400 × 240, and 320 × 240 belowButtons, touch on the lower screen
iPod touchipod-touch320 × 480Touch
Android phoneandroid360 × 640Touch

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.