Skip to main content

Build a Game with Claude Code

Early Alpha

The XGENIA MCP server and AI Agents are in early alpha. Screens and tool results change between builds.

This page follows one real run: Claude Code was asked for "a slot game with a samurai theme, 5×3, with good animations" and drove the build through XGENIA without anyone touching the editor. The screenshots were taken by Claude Code from that project, over the same debugging connection the plugin uses. The run stopped before the game was finished — Step 6 shows why, and what to do about it.

It assumes the plugin is installed — see Driving XGENIA from Claude Code.

Who does what​

Two AIs work on the game, and the run goes well when each sticks to its own job.

StepClaude CodeXGENIA AI panel
1. CheckIs the editor up? Which model? What will it cost?—
2. Set upLaunch XGENIA, create the project—
3. BriefWrite what the player sees and does—
4. BuildWatch progress, stop it if it goes astrayPlan, generate art, build the screen, wire the maths
5. ProvePress SPIN in the running game, read the balancePress SPIN and report what it saw
6. RecoverRead errors, restart the editor, resumePick up where it left off

You talk only to Claude Code. It talks to the panel.

Step 1 — Check before you spend​

The first thing Claude Code does is xgenia_health. It answers four questions in one call: is XGENIA running, is a project open, is the chat panel mounted and idle, and which model will this run use, at what cost so far.

xgenia_health
→ running: true, target: "app", authenticated: true,
chatModel: "Nemotron 3.5 Lightning:Free", chatCost: "$0.0000"

That last pair is the one that matters. A build is dozens of model calls; on the wrong model it is an expensive mistake (one ran up $94.63). Claude Code reads the model before sending a build prompt, and tells you if it is not what you expect.

The XGENIA AI model menu: thinking level slider and the model list

The panel's model menu. Free models are marked "(free)"; GLM 5.3 Flash is the default.

Step 2 — Launch and create the project​

Release builds of XGENIA only accept a driver when the harness starts them, so if XGENIA is not running, Claude Code calls xgenia_launch rather than asking you to open it.

The XGENIA launcher showing recent games, with Samurai Slots as the Continue hero

Then xgenia_new_project { name: "Samurai Slots" } creates the folder, opens the project and opens the chat panel. It refuses rather than overwrite a folder that already has something in it.

Starting by hand works too

The New game dialog has the same AI entry point: describe the game on the left and the button changes to Start with AI. Claude Code can take over from there — xgenia_open_project attaches to whatever you created.

The New game dialog with a samurai slot description typed in and a Start with AI button

Step 3 — Write the brief​

This is where the result is decided. Claude Code turns your one-line request into a brief that describes what the player sees and experiences — and leaves the how to the panel, which knows XGENIA's nodes far better than any outside agent.

The brief from this run, sent with xgenia_chat_send:

Build a complete, playable slot machine game with a samurai / feudal Japan theme.

What the player should see and experience:
- A 5 reel x 3 row grid of symbols in the centre of the screen, on a moody
feudal-Japan backdrop (dusk sky, cherry blossom trees, a pagoda or dojo
silhouette, red and gold accents).
- Themed symbols: high-value ones such as a samurai warrior, a katana, an oni
mask, a kabuto helmet; low-value ones such as a cherry blossom, a koi fish, a
paper lantern, a gold coin; plus a Wild (rising sun) and a Scatter (dragon).
- A balance display, a bet display with + and - buttons, a SPIN button, and a
win display.
- Pressing SPIN takes the bet from the balance and spins all five reels. Good
animations are the priority: reels blur and accelerate, then stop one after
another from left to right with a slight bounce when each lands.
- Paylines are evaluated left to right (at least 10 lines). Winning symbols
pulse or glow and the winning line is drawn across the grid. The win counts
up in the win display and is added to the balance.
- Big wins get a bigger celebration (e.g. falling cherry blossom petals and a
'BIG WIN' banner).
- SPIN is disabled while the reels are moving, and when the balance is lower
than the bet.

When it is built, prove it from the running game, not from the graph: press
SPIN at least three times yourself and tell me what the balance and win
displays actually showed after each spin, read from the preview.

Notice what is not in it: no node names, no ports, no component layout. And notice the last paragraph — the brief asks for evidence from the running game, which is what Step 5 checks.

"Good animations" is not a spec

"Good animations" means nothing to a builder. "Reels blur and accelerate, then stop one after another from left to right with a slight bounce" is something it can build and you can check. Every adjective in your request should become something visible.

Step 4 — Watch the build​

For a build, Claude Code sends with waitIdle: false and then polls xgenia_chat_read, a few minutes apart, reading only what is new (since: <last total>). That way it can stop a run that is going astray instead of paying for it to finish.

The editor while the panel builds: the brief in the XGENIA AI panel, the generated key art laid into the preview, the maths nodes appearing in the graph

What the panel did in this run, in order:

  1. Declared the screen — the game's size, which every piece of art inherits.
  2. Generated key art — one image of the whole game screen.
  3. Cut it up — split the key art into the backdrop, the reel frame, the ten symbols and the buttons, and saved each into the project.
  4. Placed the art into a screen layout.
  5. Built the maths — random number generator, symbol weights, the spin result — and wired it to a SPIN input.

The key art is the moment the game first looks like itself:

Key art for Samurai: Path of Honor — a 5×3 reel grid of samurai, katana, oni mask, kabuto, cherry blossom, koi, lantern, coin, Wild and dragon Scatter symbols over a dusk feudal-Japan backdrop, with a balance, bet and spin bar

Key art auto-approves after five minutes

The panel posts an approval card for key art, and waits 300 seconds for an answer. Nobody answers an unattended run, so the art auto-approves and the whole build inherits it. The panel says so in its next message — in this run: "The key art was auto-approved (nobody answered within 300s)". If the look matters to you, be there for that card, or ask Claude Code to tell you when it appears.

Each step shows up in the transcript as a tool call, its result, and the AI's thinking:

The XGENIA AI transcript: a column of tool calls — safe_connection_batch, verify_logic_correctness, inspect_node, manage_component_ports — each with a result and a collapsed thinking block

What Claude Code watches for while polling:

SignWhat it meansWhat Claude Code does
chatCost climbing fastAn expensive model or a loopStops the run and tells you
The same tool failing again and againThe AI is stuck on one mechanismReads the failures with xgenia_debug_query { tool, failuresOnly: true }
"Let me take a fresh approach" over and overThrashing — it leaves duplicate nodes behindStops it and sends a narrower prompt
A **Model Error** messageThe provider refused the turnReads the error before doing anything else (see Step 6)

Step 5 — Prove it from the running game​

When the panel says it is done, Claude Code does not take its word for it. It reads and presses the running game itself:

xgenia_preview_read → every labelled element and its current text
xgenia_preview_click { label: "Spin", times: 3, settleMs: 4000, readLabel: "Balance" }
xgenia_screenshot { region: "full" }

xgenia_preview_click returns the balance before and after each press, read from the game's own DOM. If the panel reported "the balance drops by the bet on every spin" and the balance did not move, Claude Code shows the panel that evidence and asks it to fix the wiring — the panel retracts cleanly when shown runtime evidence.

The game in Preview mode: Samurai: Path of Honor with the 5×3 reels, balance $1,000.00, bet $2.00 and the spin button

Step 6 — When it goes wrong​

This run stopped partway through Step 4. Here is how that looked, and what Claude Code did.

A Model Error card: All providers have been ignored, with a link to OpenRouter privacy settings

The run was on a free model. About 25 minutes in, OpenRouter stopped serving it: "All providers have been ignored" — the account's privacy settings did not allow the provider that model needed. A switch to another free model then hit the account's free-models-per-day limit, which covers every free model at once. Neither is a harness failure: xgenia_chat_read succeeded and returned the error as a message.

What Claude Code did:

  1. Stopped, rather than resending. The panel had already retried for two minutes; resending would only repeat the error.
  2. Explained the cause and asked you to decide — allow the provider, wait for the quota to reset, or move to a paid model — because each option costs something different.
  3. Kept the work. The key art, the pieces cut from it, the placed screen and the maths nodes are saved in the project. When the build resumes, it continues from there instead of starting over.

Other recoveries Claude Code handles on its own:

What happenedRecovery
The editor frozexgenia_restart — saves, relaunches, reopens the project. It then sends "continue — the editor restarted mid-turn; pick up exactly where you left off"
The chat panel was closedxgenia_open_chat_panel
A tool call failed and the panel's explanation does not add upxgenia_debug_export, then xgenia_debug_query on the failing tool
You were signed outStops and asks you to sign in — the harness never handles passwords

Ask for it like this​

You do not need to know any of the tool names. A request like this is enough:

Using the xgenia plugin, make me a 5×3 slot game with a samurai theme and good animations. Use the free NVIDIA model. Tell me before you spend anything, and press SPIN in the finished game yourself to check the balance changes.

Each sentence maps to a step above: the theme and layout become the brief, the model and spending go into the Step 1 check, and "press SPIN yourself" is Step 5.

Was this page helpful?