Unity & AI: Claude Code Unity Bridge
For too long, Unity Developers have been left behind on AI integration that unlocks the true potential of these incredible tools.
The State of AI-Assisted Development
In the last year, there has been a major shift in how developers work. AI-assisted coding evolved from copy-pasting code into a chat interface, to something with tangible value: agents that can actually do things.
Claude Code, Anthropic's terminal-based assistant, is a prime example. It doesn't just suggest code - it reads your files, runs commands, makes edits, and verifies its work (when you ask…). Now, from a terminal or even your ticketing system like Jira, or Linear, you can ask it to fix a bug, and it can actually run the tests to confirm the fix worked.
These coding assistants gain an additional capability boost from a system called MCPs (Model Context Protocol). This is a plugin system that enables Claude to interact with external tools. There are MCPs that allow you to connect to your database, to where your code is hosted, UI designs on Figma, and even company resources in Google Drive. The list of tools is long.
To date, most of these tools have been optimized for web development. Web developer tooling capabilities far exceed those of the game developer. They’re able to take these systems to a point where the agents have a complete feedback loop for the work they’re doing. The AI assistant can write code → tests that it compiles → run tests to ensure the code is doing what’s expected → see failures → fix → verify. There are now pipelines in place using multimodal models that can capture a screenshot or GIF of the changes and visually verify them. The AI isn't guessing anymore - it's confirming.
The Gap for Game Developers
In contrast to the incredible tools available for the web, Unity developers have fallen behind.
The Unity Editor is architecturally distinct from a Node.js server or a Python script. It's a long-running GUI process with its own compilation pipeline, asset database, and test runner. You can't just run npm test to get feedback.
This means that when AI writes Unity code, it's operating in the dark. It generates C#, hopes it compiles, and hopes the logic is right. No verification. No feedback loop. Just pure optimism, and far too much confidence. “FIXED IT!” the AI says. No… it did not.
This can be frustrating.
Existing solutions use MCP servers to bridge this gap. While they work, they also add moving parts: a server process, often specific package manager dependencies, port bindings, and server instance management for multiple projects. For teams running parallel agents across git worktrees, this coordination overhead adds up.
A Simpler Approach: Files
We asked: What's the simplest solution to the Claude gap for Unity developers?
The answer was files.
Claude Unity Bridge uses a file-based protocol. Claude writes some JSON to a command.json file. The Unity Editor polls this file, executes the command, and writes results to response-{id}.json.
That's it. The entire architecture.
No server process. No port bindings. No dependencies beyond Python 3 standard library and some C#.
What This Gets You
Zero coordination between worktrees. Each Unity project has its own .claude/unity/ directory. Run five agents across five worktrees - they never touch each other's command channels.
Run Unity in batch mode out of the box, essential for automation. It doesn’t care! The protocol works identically whether Unity is running with a GUI Editor open or headless in batch mode purely on the command line. Claude actually uses this locally to validate changes before committing.
Debuggable simplicity. When something goes wrong, you can literally read the JSON files to see what happened. No server logs to hunt through, no network debugging. Just files!
In addition, it works across Unity versions! The protocol is just file I/O and JSON. Other than the very small Unity API layer for actually triggering tests, or extracting logs that’s almost no version-specific APIs in use! In addition, adding support for other Unity versions should be incredibly simple and easy.
What It Looks Like in Practice
A typical workflow, without the bridge:
You: “Implement a new service to track players’ health”.
Claude:
- writes code
- tries to run tests
- Fails
- Confidently proclaims its completion
You:
- Check the Unity Editor to investigate
- Sees several compile errors due to imports, incorrect types, etc.
With the bridge?
You: “Implement a new service to track players’ health”.
Claude:
- Writes code
- Sees compile errors
- Corrects mistakes
- Run tests
- Sees a failing test
- Fixes the issue
- Confidently proclaims its completion!
You:
- “Wow! It works!”
The AI can write code, verify that it compiles, run tests, identify failures, understand the context, fix them, and verify the fixes. That's the feedback loop web developers rely on, now available in Unity.
Supported Commands
The current release supports:
- Run Tests - Execute EditMode or PlayMode test suites, get pass/fail results with failure details
- Compile - Trigger script compilation and surface any errors
- Refresh - Force an asset database refresh
- Get Status - Check if the editor is compiling, updating, or idle
- Get Console Logs - Retrieve recent Unity console output (errors, warnings, logs)
These cover the core feedback loop: did it compile, do the tests pass, what went wrong.
Getting Started
Here’s the quick start guide to get the bridge up and running in your project in 10 minutes or less!
- Install
macOS / Linux / Git Bash:
curl -sSL
https://raw.githubusercontent.com/ManageXR/claude-unity-bridge/main/install.sh | bashWindows (PowerShell):
irm
https://raw.githubusercontent.com/ManageXR/claude-unity-bridge/main/install.ps1 | iex
- Add to Your Unity Project(s)
In Unity: Window > Package Manager > + > Add package from git URL...
https://github.com/ManageXR/claude-unity-bridge.git?path=package- Use It
Open Claude Code in your Unity project directory:
"Run the Unity tests"
"Check for compilation errors"
"Show me the error logs"Or use the CLI directly:
unity-bridge run-tests --mode EditMode
unity-bridge compile
unity-bridge get-console-logs --limit 10Why Open Source
This was built out of necessity. AI-assisted development is changing rapidly. Even over the last few months, there has been substantial progress in the quality and capabilities of these tools. With tools available to run agents in parallel, this felt like a gap that needed to be filled for Unity.
Our team uses Claude Code daily, and the lack of a Unity integration has been a bottleneck to unlocking the same capabilities that web developers already have access to. We're open-sourcing it because:
- Many of us feel passionate about open source.
- Game dev tooling should catch up. Web developers have had these workflows for a year. Unity developers shouldn't be left behind.
- Simple protocols benefit from community input. The file-based approach is extensible - new commands are easy to add. We want to see what others build.
- It's table stakes. AI-assisted development is becoming standard. The tooling to support it should be accessible.
What's Next
The current command set covers the core feedback loop, but there's more Unity could expose: asset import status, build pipeline triggers, and scene validation. We're interested in what commands would be most valuable to the community.
Check out the repo, try it out, and let us know what you build.
