Claude Code skills for game development
On this page
Before Claude Code writes your next mechanic, it should know how to run the game and how to check it. You don’t want to paste that into every message, and you don’t have to, because project memory, skills, hooks and subagents keep those instructions around for you.
The commands and file names below come from each tool’s documentation as of September 2026, and they link to it where they appear.
Keep standing rules in memory and procedures in skills
| Piece | Where it lives | Loads | Use it for |
|---|---|---|---|
CLAUDE.md |
project root | every session | how to run, test and build; rules that apply to every task |
| Skill | .claude/skills/<name>/SKILL.md |
when a task matches, or on /name |
a job you repeat: playtest, balance pass, new enemy |
| Hook | .claude/settings.json |
on an event, every time | checks that must not be skipped: format, test, block |
| Subagent | .claude/agents/<name>.md |
when delegated | a second pair of eyes with its own context: review, asset audit |
The split matters because context is what you’re spending. CLAUDE.md costs tokens in every session, while a skill costs about a hundred tokens for its name and description until it runs, according to the Agent Skills specification. A hook doesn’t cost anything until its event fires.
Write a CLAUDE.md that fits on one screen
Anthropic suggests keeping each CLAUDE.md under 200 lines, which is plenty of room, and /init drafts one from your repo (memory docs). For a game, though, five lines carry most of the value. They say how to run it and how to test it, where the tuning numbers live, what the agent must not touch and how to know a change worked.
# My game: Three.js and Vite
- Run: `npm run dev`, then open http://localhost:5173
- Test: `npm test` (Vitest, game logic only, no browser)
- Tuning numbers live in `src/config/balance.json`, never in code
- Never edit `public/assets/` by hand: `npm run assets` builds it
- Done means: tests pass, the game loads with no console errors, and a
60-second round is playable with keyboard and touch
Two habits make a game a lot easier for an agent to change and test. The first is keeping tuning values in a data file, so “make the second level easier” is a one-line diff instead of a hunt through physics code.
The second is keeping game logic testable without a browser. A fixed timestep, as Glenn Fiedler describes in Fix Your Timestep, plus a seeded random generator, makes a round replayable in a test.
Longer notes can go in .claude/rules/*.md files with paths: in their front matter, which only load when Claude reads matching files (memory docs). That way your level design notes don’t load until someone actually opens a level file.
Turn a prompt you keep pasting into a skill
A skill is basically a folder with a SKILL.md in it. The spec requires two fields, name (lowercase, hyphens, same as the folder) and description, and suggests keeping the file under 500 lines (spec). Claude Code reads project skills from .claude/skills/, and every skill doubles as a slash command, so you can run one by name (skills docs).
Anthropic’s docs suggest writing one when you keep pasting the same instructions, checklist or multi-step procedure into chat, or when part of CLAUDE.md has grown into a procedure. For games, these three are worth writing first.
Report the playtest before asking for fixes
---
name: playtest
description: Play the game in a browser and report bugs. Use after a
gameplay change, or when the user asks to playtest or check the game.
---
1. Start the dev server with `npm run dev` if it isn't running.
2. Open the game, wait for the first frame, read the console.
3. Play one round: move, jump, collect, lose once on purpose.
4. Read `window.gameState()` after each step and compare it with what
the screen shows.
5. Report: what broke, how to reproduce it, console errors, screenshots.
Don't fix anything in this skill.
That last line is there on purpose. A playtest that also fixes things hides what it found, so keep finding and fixing as separate steps and read the report before you ask for fixes.
window.gameState() is a small function your game exposes for tests, and playtesting games with AI shows how to build it and how Claude drives the browser.
Compare tuning values before changing them
A balance skill reads balance.json, runs the game’s simulation or tests with the current numbers, and proposes changes as a table (old value, new value, why) before it touches the file. If you only want it to run when you type /balance-pass, put disable-model-invocation: true in its front matter (skills docs).
Write the enemy-adding steps once
Adding an enemy takes the same six steps every time. You need a sprite or model, stats in the data file, a spawn rule, one behavior, one test and one line in the changelog. Write those steps down once, and the tenth enemy gets built the same way as the first.
Skills can even carry files, like a references/ folder with your art style sheet or a scripts/ folder with a helper the skill runs. Inside the body, $ARGUMENTS holds whatever you typed after the command, so /add-enemy slime that splits in two reaches the skill as text (skills docs).
Hooks run your checks every time
Skills are guidance Claude can choose to follow, but some checks shouldn’t be optional, and that’s what hooks are for. A hook is a command Claude Code runs on an event like PreToolUse, PostToolUse, Stop or SessionStart, and you configure it in .claude/settings.json (hooks reference).
Anthropic calls CLAUDE.md instructions advisory, while hooks are deterministic and guarantee the action happens (best practices). Its own example formats every file Claude writes (hooks guide).
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{ "type": "command", "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write" }
]
}
]
}
}
What a hook’s result does depends on the exit code. Exit 2 from a PreToolUse hook blocks the call, and exit 2 from a Stop hook keeps Claude working. By the time a PostToolUse hook runs, the edit has already happened, so exit 2 only shows your hook’s error output to Claude (hooks reference).
Two patterns for games follow pretty directly from that.
-
Protect built files. A
PreToolUsehook onEdit|Writethat exits 2 when the path starts withpublic/assets/stops hand edits to generated art. -
Test before stopping. A
Stophook that runs your fast logic tests and exits 2 on a failure sends Claude back to fix them. Keep that test run under a few seconds, or every turn drags.
Try a new hook on a throwaway branch first, because a Stop hook that always fails will keep sending Claude back to work, over and over.
Let a subagent review the diff
A subagent gives you a second opinion from something that didn’t write the code. It’s a Markdown file in .claude/agents/ whose body is its instructions, with name and description required and tools and model optional (subagents docs). Claude delegates to one when the description matches, or you can call it by name with @agent-<name>.
Start with a read-only reviewer. Give it only Read, Grep and Glob in tools, and tell it to check a diff against CLAUDE.md and the spec. Since it never saw the conversation that produced the code, it reads the diff cold, and that’s really what you want from a reviewer.
An asset auditor makes a nice second one, checking file sizes, texture dimensions, unused files and missing credits.
Share the setup as a plugin
Once the skills, hooks and agents work, you can bundle them up as a plugin. That’s a folder with .claude-plugin/plugin.json plus skills/, agents/ and hooks/hooks.json (plugins overview), and there are already two public ones for games.
- Unity publishes an official Claude Code plugin with 29 skills (Unity blog). Install it with
/plugin marketplace add Unity-Technologies/unity-agent-plugin, then/plugin install unity@unity-agent-plugin.
It needs Unity 6 or later, and it works in Codex too. Its README warns that the skills edit scripts, scenes and assets directly, so commit first (repo).
- Claude Code Game Studios is an MIT-licensed collection with skills like
/playtest-report,/balance-checkand/asset-auditfor Godot 4, Unity and Unreal 5 (repo).
It’s really worth reading any skill before you install it. A skill is instructions plus scripts that run with your permissions, and when Snyk scanned the ClawHub and skills.sh registries, it found critical issues and even malicious payloads (Snyk).
| Snyk scan finding | Result |
|---|---|
| Scan date | February 2026 |
| Skills scanned | 3,984 |
| Critical issues | 13.4% |
| Malicious payloads | 76 |
The nice thing about the format is that it travels. Codex reads skills from .agents/skills (Codex docs), and Cursor reads them from .cursor/skills and .agents/skills, plus .claude/skills for compatibility (Cursor docs). Gemini CLI reads .gemini/skills or .agents/skills (Gemini CLI docs).
| Tool | Project instructions | Skills folder |
|---|---|---|
| Claude Code | CLAUDE.md, or AGENTS.md when there is no CLAUDE.md |
.claude/skills/ |
| Codex | AGENTS.md |
.agents/skills/ |
| Cursor | .cursor/rules/*.mdc, AGENTS.md |
.cursor/skills/, .agents/skills/, .claude/skills/ |
| Gemini CLI | GEMINI.md |
.gemini/skills/, .agents/skills/ |
From version 2.1.277, Claude Code reads AGENTS.md on its own when a repo has no CLAUDE.md (memory docs), so one instruction file can actually serve every agent.
Build one mechanic, read the playtest, then commit
A session with all of this in place starts with a spec, since Anthropic’s guide suggests letting Claude interview you and write SPEC.md first (best practices). Build one mechanic, let the Stop hook hold Claude to green tests, then run /playtest. Read the report, ask for fixes in a fresh message, and commit.
When a session wanders off, run /clear rather than correcting Claude a third time. /rewind restores code and conversation to an earlier prompt, but it doesn’t track changes made through shell commands and doesn’t replace git (checkpointing).
For scripted jobs, like a nightly balance report, claude -p "prompt" runs without the interactive UI and can print JSON with --output-format json (headless docs).
Connect the browser and the editor
MCP servers for game development connects Claude Code to a browser, Blender, Godot or Unity, and playtesting games with AI covers the gameState() hook, browser automation and deterministic tests.
If this is your first game, Claude Code game development is the simpler version of this guide. And the Claude Code hub lists all 224 games made with it so far.
Games to look at
, Phone friendly , Online multiplayerA Lost Star
Fly a ship through alien space landscapes and fight other pilots in dogfights.
, Phone friendlyBlockzilla
Play a giant kaiju smashing New York while evolving new powers each run.
, Phone friendly , Online multiplayerBeetleJump
Jump your beetle up a towering course and try to reach the top.
, Phone friendly , Online multiplayerBichitos Rumble
Shove cute animal fighters off the arena in fast, chaotic 3D brawls.
Questions
What is a Claude Code skill?
It's a folder with a SKILL.md file in it, which holds a name, a description of when to use it and the instructions, plus optional scripts and reference files. Claude Code keeps only the descriptions in context and loads a skill's instructions when a task matches, or when you type its name as a slash command.
Where do Claude Code skills go in a game project?
In .claude/skills/<name>/SKILL.md inside the project, committed with the code, so everyone who opens the repo gets them. Personal skills go in ~/.claude/skills/ instead, and they work in every project.
Do skills work in Codex, Cursor and Gemini CLI too?
Yes, SKILL.md is an open format. Codex reads skills from .agents/skills, Cursor from .cursor/skills and .agents/skills (plus .claude/skills for compatibility), and Gemini CLI from .gemini/skills or .agents/skills, according to each tool's documentation.
What is the difference between a skill and a hook?
A skill is guidance Claude chooses to follow, while a hook is a command Claude Code runs on an event, like after every file edit, whether Claude remembers it or not. So rules that must always hold belong in hooks.