Full Byte Developer.

Claude Code for game development: validators and logs

Point Claude at Godot, Unity, or Unreal tooling, validate assets and configs, then debug from build and playtest logs.

Published here , updated · 8 sources

Game work with Claude Code stays useful when config validators and playtest log triage run before any binary asset edit. Name the engine from its official manual, feed /debug real logs, protect generated folders with hooks, and keep Claude on scripts and text configs [1][2][5][6]. Related: Claude Code for coding.

Quick start: name the engine and one docs page

Open the session with engine version plus one official URL for the subsystem you are touching (scenes, input, packaging). Godot, Unity, and Unreal each publish their own manuals. Best practices say to hand Claude the file or page instead of describing it from memory [1][2][3][5].

text
Engine: Godot 4.x
Page: docs.godotengine.org export for Android
Done when: export preset validates; pack builds headless

You should see Claude cite that page when it proposes project settings changes.

Install Engineering and run /debug on real logs

bash
claude plugin marketplace add anthropics/knowledge-work-plugins
claude plugin install engineering@knowledge-work-plugins
text
/debug NullReferenceException after loading Level02 from playtest.log

The Engineering README lists /debug for reproduce, isolate, diagnose, and fix. Pipe the headless build log or playtest capture in; do not summarize away stack frames [4][5].

bash
# shape of the handoff; keep the real log file in the repo or CI artifact
wc -l playtest.log 2>/dev/null || printf 'sample\nERROR NullReferenceException: Object reference\n  at Level02.Spawn (Level02.cs:88)\n' | tee /tmp/playtest-sample.log
cat /tmp/playtest-sample.log

Captured sample used for the triage shape on this host:

text
sample
ERROR NullReferenceException: Object reference
  at Level02.Spawn (Level02.cs:88)

Ask for a single root-cause hypothesis tied to a file and line, not a rewrite of the whole scene tree.

bash
claude -p "isolate the first fatal frame and propose a failing test" < /tmp/playtest-sample.log

Add asset and config validators Claude can re-run

Write small checks for naming, missing references, and schema on text configs (.tres, allowed Unity YAML excerpts, .ini, DataTables as CSV). Claude Code best practices treat a re-runnable check as the definition of done [5].

bash
mkdir -p /tmp/game-validate/levels
printf 'id=hub\nplayer_spawn=1,2\n' > /tmp/game-validate/levels/hub.ini
printf 'id=broken\n' > /tmp/game-validate/levels/broken.ini
python3 - <<'PY'
from pathlib import Path
root = Path('/tmp/game-validate/levels')
errors = []
for path in sorted(root.glob('*.ini')):
    text = path.read_text()
    if 'player_spawn=' not in text:
        errors.append(f'{path.name}: missing player_spawn')
if errors:
    print('\n'.join(errors))
    raise SystemExit(1)
print('ok')
PY

Captured:

text
broken.ini: missing player_spawn

Fail on missing player_spawn, broken resource paths, or texture sizes outside your budget. Keep binary meshes and textures out of agent Write tools [1][2][5].

game loop with Claude Code Official docs one subsystem page /debug + logs first fatal frame Validators exit non-zero CI Hooks block Edit/Write under Content, Imported, Intermediate, DerivedDataCache Agent owns scripts and text configs; humans reimport binaries in the engine UI [6]

Keep the agent on text and checks; let the engine own binary imports.

Protect generated and content folders with hooks

A PreToolUse hook that exits 2 blocks Edit or Write under paths you treat as engine-owned (Imported, Intermediate, DerivedDataCache, large Content/ binaries). Hooks docs describe exit 2 as a hard block with stderr returned to Claude [6].

.claude/settings.json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "scripts/block-engine-generated-writes.sh"
          }
        ]
      }
    ]
  }
}

Example block script shape:

bash
#!/usr/bin/env bash
# scripts/block-engine-generated-writes.sh
file=$(jq -r '.tool_input.file_path // empty')
case "$file" in
  */Content/*|*/Imported/*|*/Intermediate/*|*/DerivedDataCache/*|*/StreamingAssets/*)
    echo "Blocked engine-owned path: $file" >&2
    exit 2
    ;;
esac
exit 0

Warning: force-saving scenes from chat can corrupt binary formats. Prefer text diffs and the engine UI for assets [2][3][6].

Wire headless build and playtest into CI language

Ask Claude to document the exact headless or batchmode command from your engine docs, then keep that command as the gate before merge. Pair with the CI page when the build farm owns the artifact [1][2][3].

bash
# Godot-shaped smoke (command from Godot docs patterns; run in your project)
godot --headless --path . --quit-after 1 --script res://tools/ci_smoke.gd

For Unity, the Manual documents batchmode and executeMethod entry points; paste the page Claude should follow rather than inventing flags [2]. Unreal docs cover commandlets and automation similarly [3].

For review discipline, continue on Claude Code for coding. For pipeline gates, use Claude Code for DevOps and CI/CD [7][8].

Keep CLAUDE.md short for game repos

Put engine version, forbidden paths, validator commands, and the headless smoke line in CLAUDE.md. Leave lore, design docs, and marketing copy out. Best practices favor short memory that points at commands the agent can re-run [5]. Long design essays belong in the repo wiki, not in every prompt.

Example shape (adapt to your engine):

text
Engine: Godot 4.3
Docs first: paste the official page for the subsystem
Never edit: res://addons/imported/, *.import binaries as source of truth
Done when: python3 tools/validate_levels.py exits 0
Smoke: godot --headless --path . --quit-after 1 --script res://tools/ci_smoke.gd

Subagents for noisy log triage

When playtest logs are huge, ask a subagent (or a separate Claude session with read-only tools) to extract the first fatal frame and the ten lines around it. Feed only that slice to /debug. That keeps the main session focused on the fix instead of re-reading megabytes of frame dumps [4][5].

Asset pipeline boundaries

Text that Claude may edit: scripts, .tres / .gd / C# sources you treat as source, CSV tables, JSON configs, shader code when your team reviews it as code.

Text Claude may propose but humans apply: scene structure changes that the engine serializes in binary or opaque formats.

Files Claude must not Write: compressed textures, meshes, audio, packed packages, engine-generated import sidecars you treat as build outputs [1][2][3].

Document the boundary in the hook script so the refusal message names the path class, not just "blocked".

Local smoke before CI minutes

Run the validator and a short headless boot on the developer machine before pushing. CI then confirms a clean environment, not the first discovery of a missing spawn point. When headless needs display stubs or GPU, record the exact container or xvfb command next to the smoke line so Claude does not invent flags [1][2].

Mistakes that waste a playtest day

Letting Claude rewrite .uasset, .fbx, or packed scene binaries because "it is just a file".

Summarizing away stack frames before /debug, so the model invents a scene-wide refactor.

Skipping a validator that Claude can re-run, so "done" means a chat claim instead of an exit code [5].

Leaving Content/ and import caches writable to Edit/Write hooks.

Pointing Claude at three engines at once without naming which manual page wins.

Asking Claude to "optimize all levels" without a failing validator or log as the definition of done.

Review diffs the way coding pages do

After validators pass, run the same review discipline you use on ordinary code: small diffs, named risks, and a human merge. The coding page covers /review, hooks for lockfiles, and checklist commands; reuse that loop here once the engine-specific gates are green [5][7]. Do not skip review because the change "only touches a level CSV."

Close the loop before merge

  1. Official docs URL for the subsystem [1][2][3].
  2. /debug on the real log [4].
  3. Validator exit code green [5].
  4. Hooks blocking engine-owned paths [6].
  5. Headless or batch smoke in CI language [1][2][3].
  6. Human review of the text diff before merge [7].

You now have a game loop: official docs as API, /debug on real logs, config validators, hook-protected content paths, headless smoke before merge. Keep Claude useful by narrowing the write surface, not by asking it to own the whole project tree.

When a session drifts into binary asset edits, stop and restate the boundary. The refusal from a PreToolUse hook is a feature. If you need a scene change the engine only stores as binary, do that edit in the editor, then let Claude update the scripts and validators that surround it [2][3][6].

Keep a short incident note when a hook blocks a path you later decide should be writable. Update the allowlist on purpose, not by disabling hooks for the afternoon. The goal is a boring, repeatable game-coding loop that survives a bad playtest Friday.

Browse the Claude Code topic.

Send this to the friend who wants Claude on scripts and leaves gameplay systems alone.

Isometric dark grid: glowing cyan cube on a left pedestal, grey pillar lattice in the middle, amber cylinder gate emitting concentric light rings, and a right platform of grey blocks under a gold timeline with round markers. Teal arrows link the modules.
Validators and log triage sit mid-loop; keep binary content off the agent write path.

Keep this guide

By Full Byte Developer

Filed under Claude Code, Dev tools

Questions about this guide

Which engine docs should I keep open?

Use the official manuals: Godot stable docs, Unity Manual, or Unreal Engine documentation from Epic. Paste the exact page Claude should follow for a subsystem.

What does Engineering /debug add?

Anthropic's Engineering plugin documents /debug as a structured session: reproduce, isolate, diagnose, and fix. Feed it the failing log, not a vague vibe.

How do hooks help game repos?

PreToolUse hooks can block edits under StreamingAssets, Content, or generated import folders you treat as sacred. Exit code 2 refuses the write.

Should Claude rewrite binary assets?

No. Keep agents on text configs, scripts, and validators. Reimport through the engine's own tools after a human reviews the change list.

Sources

Next in this stack