●WWDC — WWDC 2026 confirms Siri runs on Google Gemini; third-party handoff to ChatGPT is dropped, and Siri AI won't ship in the EU under the DMA at iOS 27●BILLING — 6 days until the Jun 15 change: Agent SDK, headless Claude Code, GitHub Actions, and third-party agents move to API-rate monthly credit●OUTAGE — claude.ai, Claude Code, and Cowork saw an outage (Jun). Scheduled runs are safest when built around fallbackModel and retries●DYNAMIC-WORKFLOWS — Dynamic workflows are on by default on Max/Team and the API, for codebase-wide bug hunts and independent verification●ULTRACODE — Claude Code's new ultracode setting sits in the effort menu, fixing effort to xhigh while Claude decides when to run a workflow●OPUS4.8 — Claude Opus 4.8 is settled in as the default across major plans, with stronger coding, agentic, and reasoning skills●WWDC — WWDC 2026 confirms Siri runs on Google Gemini; third-party handoff to ChatGPT is dropped, and Siri AI won't ship in the EU under the DMA at iOS 27●BILLING — 6 days until the Jun 15 change: Agent SDK, headless Claude Code, GitHub Actions, and third-party agents move to API-rate monthly credit●OUTAGE — claude.ai, Claude Code, and Cowork saw an outage (Jun). Scheduled runs are safest when built around fallbackModel and retries●DYNAMIC-WORKFLOWS — Dynamic workflows are on by default on Max/Team and the API, for codebase-wide bug hunts and independent verification●ULTRACODE — Claude Code's new ultracode setting sits in the effort menu, fixing effort to xhigh while Claude decides when to run a workflow●OPUS4.8 — Claude Opus 4.8 is settled in as the default across major plans, with stronger coding, agentic, and reasoning skills
Hands-on guide to using Claude Code on real Unity projects: writing CLAUDE.md for Unity, the Unity MCP server, scene-aware C# generation, PlayMode tests, and build verification.
The longer I work in Unity, the more often I think "this would be faster if I just had Claude Code do it." But Unity isn't like web development. Scenes carry state. Asset import settings live outside source files. Build configuration is in .meta files no one wants to read. Claude Code alone hits a wall fast.
This guide collects the techniques I've actually shipped with — and the patterns I've seen burn through credits without producing working code — across several Unity 6 projects with Claude Code v2.
Why Claude Code lands well in Unity, when set up right
Unity development time breaks roughly into four buckets: scene composition, asset tuning, C# implementation, and build verification. C# implementation is the part that maps cleanly to AI-generated code. The same skill set that writes good TypeScript writes good Unity C#.
What makes Unity hard is that writing the script isn't enough. You still need the right GameObject hierarchy, the right SerializeField references wired up, the right Layer and Tag assignments. Code that compiles but isn't wired into the scene does nothing.
Claude Code only really pulls its weight in Unity once you bridge it to the editor itself with the Unity MCP server, which I'll cover below. Before that bridge exists, Unity work with Claude is half automated at best.
Writing CLAUDE.md for a Unity project
The first thing Claude Code reads on startup is CLAUDE.md. Here's an excerpt from the template I'm currently using:
# ProjectVertical-scroll action game on Unity 6.0.x.Targets: iOS / Android (IL2CPP, ARM64).Render pipeline: URP 17.x.Input: Input System Package — do NOT use legacy Input Manager.# Directory layout- Assets/Scripts/Gameplay/ — gameplay logic, MonoBehaviours- Assets/Scripts/Systems/ — persistence, save/load, audio- Assets/Scripts/UI/ — UI Toolkit screens- Assets/_Project/Prefabs/ — player, enemies, items# Coding conventions- using statements: alphabetical- Private fields: _camelCase. Public: PascalCase- async/await: UniTask (Cysharp). Bare Task is forbidden- DOTween: always use SetLink for lifetime safety- Prefer ScriptableObject for tunable values# Tests- PlayMode tests live in Tests/PlayMode/- EditMode tests live in Tests/EditMode/- NUnit + UnityEngine.TestTools assertions
The point is to block web-development assumptions from leaking in. Without "bare Task is forbidden," Claude will happily use await Task.Delay() — which, in Unity, doesn't track the MonoBehaviour lifecycle and keeps running after scene unload. That's a future bug factory.
Calling out URP and the Input System matters too. Skip them and you'll get URP-incompatible shaders and Input.GetKeyDown calls from the legacy input system.
✦
Thank you for reading this far.
Continue Reading
What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.
WHAT YOU'LL LEARN
✦How to write a CLAUDE.md tailored to a Unity project's structure and conventions
✦Automating scene operations with the Unity MCP server
✦An end-to-end loop: Claude generates code, runs PlayMode tests, and verifies builds
Secure payment via Stripe · Cancel anytime
Unity MCP: bringing scene operations into the loop
Unity's MCP (Model Context Protocol) server lets Claude Code drive the editor itself. Concretely, it exposes:
listing GameObjects in the active scene
creating GameObjects, adding components
reading and writing Inspector fields, marking as Prefab
invoking menu commands (e.g., File > Build Settings)
streaming Console logs
Setup goes through Unity Package Manager:
# 1. Add to Packages/manifest.json:{ "dependencies": { "com.unity.mcp.server": "1.x.x" }}# 2. Register the bridge in Claude Code:claude mcp add unity-editor \ --command "node" \ --args "/path/to/unity-mcp-bridge/index.js" \ --env UNITY_PROJECT_PATH=/path/to/your/project
The tool I rely on most heavily is "list scene objects, then read the components on this specific one." Once that exists, the cost of explaining your scene structure to Claude drops to nearly zero.
A real example: "Change the player's move speed from 5.0 to 7.5, and add an accelerometer-based fine adjustment." Claude Code now runs:
Calls unity_get_scene_objects to find the Player
Reads the existing PlayerMovement script
Updates moveSpeed to 7.5
Creates a new IAccelerometerInput interface
Refactors PlayerMovement to use it
Wires up the SerializeField references via Inspector
Runs PlayMode tests to confirm behavior
Zero human intervention until step 7's report. In web terms, that's the difference between "AI writes code" and "AI writes code, deploys to staging, and runs smoke tests."
Tactical tips for higher-quality C# generation
Be explicit about MonoBehaviour lifecycle
MonoBehaviour has many entry points: Awake, Start, OnEnable, Update, FixedUpdate, LateUpdate. Claude leans web — it puts everything in Start. Telling it "init in Awake, register listeners in OnEnable, unregister in OnDisable" sharply improves output quality.
Pin down namespaces
A common failure: it writes using UnityEngine; and forgets UnityEngine.UI or UnityEngine.InputSystem. Document which UI and input frameworks the project uses in CLAUDE.md so the imports come out right.
Push values into ScriptableObjects
Game balance numbers (jump force, enemy HP, item duration) hurt later when they're hardcoded. Tell Claude up front: "Tunable parameters belong in ScriptableObjects, not literals."
Closing the loop on builds
Unity MCP's execute_menu_item lets Claude trigger File > Build And Run. Full device deployment still needs Xcode/Android Studio handoff, but whether the build itself succeeds is automatable.
The loop I run looks like:
1. Claude implements the feature
2. Writes a PlayMode test, verifies in-editor
3. Validates Player Settings via unity_execute_menu_item
4. Pulls Console logs on build error, asks Claude to fix
5. Build And Run on success
After this cycle, the only thing I personally check is how the game feels on the device. Knowing that compile errors will be caught and fixed by AI is, on its own, a different developer experience.
Editor extensions: a surprising sweet spot
Custom editor windows — balancing panels, level editors, debug tools — eat real time in Unity work. Claude Code writes them surprisingly well. Ask for "an EditorWindow that lists enemy ScriptableObjects and lets me edit them in place" and you get appropriate SerializedObject and EditorGUILayout usage out of the box. Think of it as the same thing as asking it to scaffold an admin panel in a web app — it's just an internal tool with different APIs.
Things to avoid
A few patterns to keep away from.
Hand-written HLSL shaders are risky. Skip Shader Graph and ask Claude to write raw HLSL, and you'll get pipeline mismatches and version-specific code that doesn't compile. Build the shader in Shader Graph and let Claude write only the Custom Function Node body.
Don't let Claude bulk-edit asset import settings. A request like "compress all textures to ASTC" via AssetImporter can hit assets you didn't intend. Always narrow the scope first.
Don't ask Claude to edit .unity scene files directly. They're YAML, but they are not human-edit-safe. If Claude proposes editing a .unity file, stop and switch to operating through the editor.
What to do first
If you only try one thing from this guide, install Unity MCP. Everything else can wait. The moment Claude can see and operate the scene, conversations stop being "let me describe the hierarchy" and become "do the thing." That single shift is what makes AI pair programming in Unity feel real.
After that, fill in CLAUDE.md with your project's actual conventions, libraries, and naming rules. The output quality is roughly proportional to how complete that file is.
Why Claude Code Excels at Unity Development
Claude is exceptionally well-suited to game development for several reasons.
Deep Knowledge of C# and Unity APIs
Claude understands both C# language semantics and the Unity ecosystem—GameObject hierarchies, the Component pattern, Transform math, Physics calculations, coroutines, and async workflows. It generates code that respects Unity's architectural conventions.
Architectural Thinking for Complex Systems
Games involve many interacting systems: player input, enemy AI, particle effects, UI management, audio, and save data. Claude thinks structurally about these dependencies, proposing loosely coupled designs that remain maintainable as complexity grows.
High-Value Time Reclamation
A developer's time is most valuable when spent on game feel, balance, and creative problem-solving. Claude handles the coding and initial debugging, freeing you to iterate on what makes games engaging.
Setup: Getting Claude Code Running in Your Unity Project
Claude Code now monitors your Git state and tracks changes automatically.
In Practice: Delegating Common Unity Tasks to Claude Code
Example 1: Generate a Complete PlayerController
Your instruction:
Create a PlayerController that:
1. Accepts WASD/arrow input for 2D movement
2. Implements jump with configurable force and gravity
3. Transitions between Idle, Walk, and Jump animation states
4. Detects ground using a raycast
5. Expose moveSpeed, jumpForce, groundDrag as [SerializeField]
Save as Assets/Scripts/Player/PlayerController.cs
Implements reliable ground detection using raycasting
Exposes all parameters in the Inspector for balancing
You paste it into Unity, adjust values in the Inspector, press Play, and it works. No debugging needed.
Example 2: Fix a Tricky Bug
You discover during playtesting that the player can jump twice in mid-air (double jump bug).
Your instruction:
The PlayerController has a double-jump bug. The player can jump
while already airborne. Review this code (paste your script) and
identify the root cause in the ground detection logic. Propose a
robust fix that prevents any jumping except when grounded.
Claude analyzes the code, identifies the specific condition causing the bug (likely a timing issue in ground check), and provides a corrected implementation. It might even suggest alternative approaches (Physics.OverlapCircle vs. Raycast) with pros/cons for each.
Example 3: Build an Editor Window
Your game's configuration system is becoming complex. You need an editor tool to manage ScriptableObject configs.
Your instruction:
Create an Editor Window (Assets/Editor/ConfigManager.cs) that:
1. Lists all ScriptableObject configs in the project
2. Shows a preview of key properties
3. Has buttons to Create, Delete, or Open each config
4. Includes a search bar to filter by name
5. Inherit from EditorWindow and add to a menu
Claude generates a fully functional EditorWindow. Your content team now has a quick tool to manage game data without touching code.
Automating Unity Builds with Claude Code /hooks
Claude Code's /hooks feature lets you run scripts automatically before or after builds.
Pre-Build Validation Hook
claude-code /hooks add pre-build --cmd "npm run validate:project"
Create a validation script that ensures:
All GameObjects follow naming conventions
No circular dependencies between scripts
BuildSettings target the correct platform
No stray Debug.LogError calls
If validation fails, the build is blocked, preventing broken builds from reaching testers.
Post-Build Automated Testing
claude-code /hooks add post-build --cmd "npm run test:playmode"
After a successful build, automatically run your Unity Test Framework tests. Regression bugs are caught immediately.
Pre-Release Asset Size Check
claude-code /hooks add pre-release --cmd "npm run check:size"
Ensure the final build doesn't exceed app store limits or contain uncompressed assets. Catch optimization oversights before submission.
Tips and Caveats for Effective AI-Assisted Game Development
Critical: Document Unity Version in CLAUDE.md
Unity's APIs evolve across versions. The Input System, rendering pipelines, and UI frameworks differ between 2022 LTS, 2023, and 2024. Your CLAUDE.md should explicitly state:
Asset Pipeline: Connecting 3D models, animations, and shaders. Claude handles scripting; artists handle asset creation.
Start Small, Build Trust
Begin with Claude Code on small tasks (utility functions, simple UI scripts). Once you're confident in the quality, graduate to larger systems (complete subsystems, complex AI behavior).
Claude Code transforms Unity development from coding-heavy to design-heavy. You shift from "How do I implement this?" to "What should this character feel like?" The AI handles implementation while you focus on the creative decisions that make games great. Set up CLAUDE.md, start with small tasks, and watch your development velocity multiply.
Share
Thank You for Reading
Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.