How to Connect Claude Code to Roblox Studio
Connect Claude Code to Roblox Studio so AI-written Luau code syncs directly into your game. One-command setup or step-by-step manual guide.
Claude Code Doesn't Connect to Studio — You Need a Bridge
Claude Code can't talk to Roblox Studio directly. There's no plugin, no API, no magic button. Studio is a walled garden that only speaks its own protocols.
The fix: Rojo. It syncs files from your computer into Studio in real-time. Claude writes code to your project folder, Rojo pushes it into Studio. That's the entire pipeline:
You can set this up in one command with Roxlit, or do it manually. Both paths below.
What's the Fastest Way to Connect Them?
Run this in your project folder:
npx roxlit setupDone. Roxlit installs Rojo, configures the Studio plugin, creates your project structure, and generates the AI context files that make Claude understand Roblox. Start building.
If you prefer to wire everything yourself (or if you want to understand what that command actually does), keep going.
How to Connect Manually (Step by Step)
1. Install Rojo
Rojo needs a tool manager called Aftman. Two commands:
aftman add rojo-rbx/rojo
rojo --versionIf the second command prints a version number, you're good. If it says "command not found," close your terminal and open a new one. PATH issues. Every single time.
2. Create a Rojo Project
Navigate to your game's folder and run:
rojo initThis creates a default.project.json that maps local folders to Roblox services. The default structure looks like this:
| Local folder | Roblox service |
|---|---|
src/server/ | ServerScriptService |
src/client/ | StarterPlayerScripts |
src/shared/ | ReplicatedStorage |
Any .luau file you drop in these folders will appear in Studio once Rojo is running.
3. Install the Rojo Plugin in Studio
rojo plugin installThis places the Rojo plugin in your Studio plugins folder. Restart Studio if it's open. You should see a "Rojo" button in the Plugins tab.
4. Start the Sync Server
rojo serveLeave this terminal open. In Studio, click the Rojo plugin button, then "Connect." The status should flip to connected. Now every file change syncs automatically.
5. Run Claude Code
Open a second terminal in the same project folder:
claudeAsk it to create something: "Build a coin pickup system with a counter UI." Claude writes the files, Rojo syncs them to Studio. You'll see the scripts appear in real-time.
That's the connection. Two terminals — Claude in one, Rojo in the other — and Studio reflecting changes instantly.
Why Does Claude Write Bad Roblox Code at First?
Connection is only half the problem. By default, Claude doesn't know you're building a Roblox game. It'll write Lua 5.1 instead of Luau, use wait() instead of task.wait(), miss Roblox services entirely.
The fix is a CLAUDE.md file in your project root. Claude reads it automatically on every session. Put your game's rules, patterns, and structure there. A basic version:
# Roblox Project: Luau Only
## File Naming
- *.server.luau → Server Script
- *.client.luau → Local Script
- *.luau → ModuleScript
## Rules
- Use task.wait(), never wait()
- Set Parent last on Instance.new()
- Validate everything on server, never trust client
- Use RemoteEvents for client-server communicationRoxlit generates this file automatically with a much more detailed version. But even these 10 lines will stop Claude from writing JavaScript in your Roblox project.
For a deep dive on getting better results from Claude once you're connected, check out How to Use Claude Code with Roblox Studio.
What About the Other Direction: Studio to Claude?
The pipeline above is one-way: Claude writes code, Rojo pushes to Studio. But what about reading what's already in Studio?
Rojo handles this too. It syncs both directions: scripts, instances, models, properties. If you edit something in Studio, the change appears in your local files, and Claude can read it. Rojo doesn't just do scripts. It handles your entire game tree through project files.
What Can Claude Do Beyond Writing Files?
With just Rojo, Claude writes files and they sync to Studio. Scripts, instances, models: Rojo handles all of that through project files. But the AI is still working blind. It writes code, saves it, and hopes it works. It can't test anything, can't see errors, can't check if that Part it created is actually in the right position.
Roxlit includes an MCP server that gives Claude runtime access to Studio. This means Claude can:
- Execute Luau code inside Studio: test a function, query game state, check if a part exists at a position
- Run playtests: start a play session, capture console output, stop the test, all from your terminal
- Read the game hierarchy: ask "what's in Workspace right now?" and get a real answer
- Create things on the fly: spawn a Part, build a GUI, adjust lighting, and immediately verify it worked
The difference: without MCP, Claude writes code and you test everything manually. With MCP, Claude writes code, runs it, sees the result, and fixes issues on its own.
Example: "Build a lobby with a spawn area and a leaderboard GUI." Without MCP, Claude writes the files and you open Studio to check if it looks right. With MCP, Claude creates the lobby, runs a query to verify the spawn position, checks the GUI renders correctly, and fixes layout issues — all in one conversation.
Rojo gives Claude a way to build your game through files. The MCP server gives Claude eyes and hands inside Studio to verify and iterate on what it built.
Does This Work with Other AI Tools?
Same principle, different context file. Cursor uses .cursorrules instead of CLAUDE.md. Windsurf, Copilot, Cline. They all work through the same Rojo bridge. The only thing that changes is how you tell the AI about Roblox.
Roxlit supports Claude Code and Cursor out of the box. Pick your tool during setup.
Frequently Asked Questions
Can Claude Code run inside Roblox Studio?
No. Claude Code runs in your terminal, completely separate from Studio. Rojo is the bridge that syncs files between them. They never talk to each other directly.
Do I need to pay for Claude Code?
Yes. Claude Code requires an Anthropic API key with usage-based pricing. A typical Roblox dev session costs a few dollars. Heavy use might hit $10-15/month. Still cheaper than the time you save.
What if Rojo won't connect?
Check three things: Is rojo serve running in your terminal? Did you install the Rojo plugin in Studio? Is Studio trying to connect to localhost:34872? If all three are yes and it still fails, restart Studio. The plugin sometimes doesn't load on first install.
Is Roxlit the same as Rojo?
No. Rojo syncs script files between your editor and Studio. That's it. Roxlit is a full development launcher that includes Rojo for file sync, plus an MCP server that lets AI tools execute code inside Studio, create 3D objects, run playtests, and read game state. Think of Rojo as one piece of the pipeline. Roxlit is the whole pipeline.
Rojo gives Claude a way to write scripts. Roxlit gives Claude hands inside Studio: file sync, code execution, instance creation, playtesting, all wired up with one command.