Claude Code for Game Dev: CLAUDE.md Templates for Unity and Godot

Published Oct 21, 2026 · 5 min read

Claude Code is good at game code and bad at game projects. It will happily write a C# controller or a GDScript state machine, then move an asset without its .meta file, rewrite a scene file by hand, or wander into a cache folder with thousands of generated files. The fix is a short CLAUDE.md at the project root that tells it where the danger is. Below are two copy-paste templates, one for Unity and one for Godot 4, and the reasoning behind each rule.

Unity CLAUDE.md template

# CLAUDE.md (Unity project)

## Project
- Unity version: see ProjectSettings/ProjectVersion.txt. Don't upgrade it.
- Game code lives in Assets/Scripts/. Tests live in Assets/Tests/.

## Never touch
- Library/, Temp/, Obj/, Logs/, UserSettings/ are generated. Don't read or edit them.
- Every asset has a .meta file with its GUID. When you move, rename or delete an
  asset, do the same to its .meta file, and never invent or change a GUID.
- Don't hand-edit .unity, .prefab or .asset YAML. Ask me to make scene and prefab
  changes in the Editor, and tell me exactly what to change.

## Code style
- C#: one MonoBehaviour per file, file name = class name.
- Use [SerializeField] private fields, not public fields, for inspector values.
- No allocations or GetComponent/Find calls inside Update(); cache in Awake().

## Tests
- Run EditMode tests from the CLI (close the Editor first):
  Unity -batchmode -projectPath . -runTests -testPlatform EditMode -testResults results.xml
- A task is done when tests pass and there are no new compiler warnings.

Why these Unity rules matter

Godot 4 CLAUDE.md template

# CLAUDE.md (Godot 4 project)

## Project
- Godot 4.x, GDScript. Entry scene is set in project.godot. Don't change engine settings.
- Scripts live next to their scenes. Autoloads are listed in project.godot.

## Never touch
- .godot/ is the editor cache. Don't read or edit it.
- Commit and keep *.import files and *.uid files next to their assets. If you move or
  rename a resource, move its .import/.uid file with it.
- Prefer editing .gd scripts. Only edit .tscn/.tres text when the change is small and
  you keep every ext_resource id and uid intact.

## Code style
- Use static typing: var speed: float = 200.0, func move(delta: float) -> void.
- Signals over get_node() chains across scenes. Use @onready for node references.
- snake_case for files, functions and variables; PascalCase for class_name.

## Tests
- Tests use GUT in addons/gut/. Run them headless:
  godot --headless -s addons/gut/gut_cmdln.gd -gexit
- A task is done when tests pass and the project opens with no script errors.

Why these Godot rules matter

Tips that work in both engines

FAQ

Can Claude Code make a Unity or Godot game?

Yes, for the code. Claude Code reads and writes C# and GDScript and can run tests from the command line. Scene, prefab and asset work is safer done in the editor, so a good CLAUDE.md tells Claude to describe those changes for you instead of editing the files.

Why does Claude Code break Unity .meta files?

Each Unity asset has a .meta file holding its GUID, and other assets reference it by that GUID. If an agent moves or deletes an asset without its .meta file, or writes a new GUID, references break. Put the .meta rule in CLAUDE.md.

Which Godot folders should Claude ignore?

The .godot/ folder is Godot 4's editor cache and should be ignored and kept out of git. Keep *.import and *.uid files, since they belong to your assets.

Should I use AGENTS.md instead of CLAUDE.md for a game project?

If you also use Cursor or Codex, put the rules in AGENTS.md and start CLAUDE.md with @AGENTS.md so Claude Code imports it. Our AGENTS.md guide shows the setup.

The VibeKit Dispatch

One tested Claude Code / Cursor workflow every week. No hype, unsubscribe anytime.