How to Use Claude in Unity | Getting Started with AI-Assisted Game Development
For those who want to use Claude in Unity to accelerate game development, here are two options — from getting started immediately to full integration. If you only need C# generation, you can start today without MCP. If you want to delegate scene operations as well, Unity MCP integration lets you drive the entire editor with AI. This guide covers the setup steps for both approaches, how to decide which to use, and key tips for working with CLAUDE.md.
There are two ways to bring Claude into Unity — without MCP and with Unity MCP integration — and the right choice depends on your goals. For prototyping, the first option lets you start on day one; for production development, the second lets you delegate even editor operations to AI.
Without MCP, you simply launch claude at the root of your Unity project. For full integration, you install the plugin via unity-mcp-cli and then start Claude Code. In both cases, installing the Claude Code CLI in advance and defining rules in CLAUDE.md are critical to success.
The golden rule is to limit AI edits to the script layer — direct YAML editing of Scenes and Prefabs is strictly prohibited. Asking for three design proposals before moving to implementation, and adding prohibitions to CLAUDE.md, will continuously improve quality.
目次 (9)
- Two Approaches for Integrating Claude into Unity
- Prerequisites: Installing Claude Code
- Approach 1: Get Started Now Without MCP
- Approach 2: Full Integration with Unity MCP
- Defining Project Rules with CLAUDE.md
- How to Write Effective Prompts
- Dedicated Plugin for the Unity App UI Package
- Good Use Cases and Poor Use Cases
- Caveats and Common Pitfalls
Two Approaches for Integrating Claude into Unity
There are two main ways to use Claude in Unity.
Approach 1: Without MCP (Start Immediately)
Simply install Claude Code and launch it from the root folder of your Unity project. You can immediately start generating, editing, and reviewing C# code. No additional setup is required — you can start today.
Approach 2: Unity MCP Integration (Full Integration)
This lets Claude directly operate the Unity editor itself — placing objects in scenes, auto-fixing compile errors, and checking the state of GameObjects. Setup takes one to two hours, but dramatically expands what you can accomplish.
Which approach to start with depends on your project's scale and goals. Approach 1 is sufficient for prototyping; for production development, Approach 2 is worth considering.
Prerequisites: Installing Claude Code
Both approaches share a common requirement: the Claude Code CLI. First install Node.js 18 or later, then run the following.
npm install -g @anthropic-ai/claude-code
After installation, if claude --version displays a version number, you're ready. Using Claude Code requires an Anthropic account and a Pro or Max plan (starting at $20/month). For heavy usage like long-running Unity development sessions, the Max plan may be worth considering (as of June 2026 — check the Anthropic pricing page for the latest plans and pricing).
Source: Qiita — How I use Claude Code in Unity
Approach 1: Get Started Now Without MCP
Open a terminal in the root directory of your Unity project and run the claude command to launch Claude Code. Here's what you can do from this state:
- C# script generation: Generate code from natural language instructions like "implement a player jump mechanic"
- Code review: Have Claude read existing scripts and receive bug reports and refactoring suggestions
- Design consultation: Get multiple design options presented before moving into implementation
One important caveat: never let AI directly edit Scene files or Prefab YAML. These are internal formats managed by the Unity editor and are highly susceptible to corruption from text editing. Limiting edits to the script layer is the fundamental rule of this approach.
Approach 2: Full Integration with Unity MCP
By installing a Unity MCP (Model Context Protocol) server, Claude gains direct access to the Unity editor's API. Over 100 built-in tools become available, enabling automation of scene operations, asset management, and compile control.
Setup Steps (CLI Method)
npm install -g unity-mcp-cli
unity-mcp-cli install-plugin ./MyUnityProject
unity-mcp-cli login ./MyUnityProject
unity-mcp-cli open ./MyUnityProject
unity-mcp-cli wait-for-ready ./MyUnityProject
After wait-for-ready completes, launch claude from the project root. The Unity editor must be running — this is a required condition.
Alternatively, you can use the Package Manager. In the Unity editor, go to Window > Package Manager, add the Unity MCP package, and click "Start Server" to launch the MCP server. To connect with Claude Code, create .mcp.json in the project root with the following minimal configuration:
{
"mcpServers": {
"unity": {
"type": "sse",
"url": "http://localhost:8080/sse"
}
}
}
The basic format is: mcpServers key → server name → transport type (type) → endpoint (url). You can also register this with the command claude mcp add unity http://localhost:8080/sse --transport sse. You only need one of the CLI method (unity-mcp-cli) or the Package Manager method — both achieve a connection to the same MCP server via different steps. The CLI method handles plugin installation and connection registration in one go, while the Package Manager method starts the server from the editor and requires you to manually specify the connection in .mcp.json.
Source: dot-ai.myuuu.co.jp — How to Develop Games with Claude Code and Unity
Once MCP integration is complete, a single instruction like "add a player GameObject to the scene and attach a Rigidbody" will reflect changes directly in the editor's scene. Since AI can inspect and manipulate object states even while the game is running, real-time debugging becomes possible as well.
Defining Project Rules with CLAUDE.md
With either approach, placing a CLAUDE.md file in the project root dramatically improves the AI's understanding of your project. Here's what to include:
# Game Overview
- Genre: 2D Platformer
- Target: Mobile
# Technical Specs
- Unity 2022.3 LTS / URP
# Packages Used
- DOTween, Cinemachine, TextMeshPro
# Project Structure
Assets/
Scripts/ # All C# scripts
Prefabs/ # Prefabs
Scenes/ # Scene files
# Naming Conventions
- Class names: PascalCase
- Private fields: _camelCase
- No MonoBehaviour (Model layer)
The No MonoBehaviour (Model layer) rule is a design principle that keeps the Model layer — responsible for data and logic — in pure C#, decoupling it from Scene dependencies and making it easier for AI to write unit tests. This is directly tied to the "test-driven development (pure C# tests for the model layer)" use case discussed later in the "Good Use Cases" section.
CLAUDE.md is a living document. When the AI makes the same mistake repeatedly, add it as a "prohibition" and continuously improve accuracy.
Source: Qiita — How I use Claude Code in Unity
How to Write Effective Prompts
The quality of your instructions to Claude directly determines the quality of the output. Here are effective prompting patterns for Unity development.
Start with design
Instead of "build this," ask "propose three design approaches and explain the trade-offs of each." Getting the design locked in before implementation improves quality.
Be explicit about scope
Specifying "only fix this method" or "stay within this class" prevents unexpected changes to unrelated parts of the codebase.
Communicate your game design intent
Rather than "add gravity," say something like "when the player falls off a cliff, I want a floaty, drifting feel." Let the AI handle the implementation details.
Be mindful of session resets
In long conversations, context tends to get forgotten. Resetting the session for each major feature and re-referencing CLAUDE.md and relevant code at the start is the most stable approach.
Dedicated Plugin for the Unity App UI Package
For projects using Unity's App UI package, an official dedicated Claude Code plugin is available.
In Package Manager, select App UI, then click "Install All" under "AI Agent Skills" to place skill files in .claude/skills. These skills cover the following areas:
- Components, styling, and MVVM
- Navigation system (NavGraph, NavController)
- Redux state management (Store, Slices, Reducers)
- Theming (USS variables, dark/light mode)
Skills can be triggered automatically from natural language questions, or called directly:
/app-ui:app-ui-navigation
Source: Unity Official Documentation — Claude Code Plugin
Good Use Cases and Poor Use Cases
Here's a breakdown of where Claude × Unity excels and where it's still difficult to rely on.
Good Use Cases
- UI systems, inventory, and shop screen implementation
- Save & load systems, enemy AI behavior logic
- Prototyping (implementing a basic game loop in a few hours)
- Code review and refactoring
- Test-driven development (pure C# tests for the model layer)
Poor Use Cases
- Writing complex custom shaders
- Tuning high-precision physics simulations
- Generating 3D models, textures, and other assets (separate tools required)
Some overseas developers have reported using it for 10 months straight, significantly reducing their programming time and freeing them to focus on QA testing and design.
Caveats and Common Pitfalls
Always manage Git yourself
Do not let AI handle commits or pushes. Always review output code manually before committing.
Launch from the project root
Claude Code recognizes files relative to the directory it's launched from. Starting from the Assets or Scripts folder means it won't be able to find CLAUDE.md or configuration files.
Keep the Unity editor running
When using MCP integration, closing the Unity editor will break the connection. Be conscious of keeping the editor open during long work sessions.
Port conflicts on Windows
The default port (8080) may conflict with other applications. Change the port via environment variables as a workaround.
Always wait for wait-for-ready
After MCP integration, skill auto-generation takes a few minutes to complete. Launching Claude before this command finishes means the tools won't be recognized correctly.
The combination of Claude and Unity has grown into a full-fledged AI pair development environment that goes beyond coding assistance to integrate editor operations. The recommended path is to start with the simple configuration without MCP, then step up to MCP integration as your project matures.