Repository navigation
How it works
┌──────────────── Godot editor ────────────────┐
│ Dock / One-shot screen Script Editor │
│ │ ▲ │
│ SessionController ── EditorSync ─┘ │
│ │ ▲ │
│ │ ACP │ MCP (HTTP, 127.0.0.1 + token) │
└─────┼───────┼────────────────────────────────┘
▼ │
Agent process (Claude Code, Antigravity…)
The agent runs as a child process of the editor. The harness talks to it over its stdin/stdout with the Agent Client Protocol (JSON-RPC):
-
initializeandsession/newopen a session in your project's folder; -
session/promptsends what you write, plus a short harness context: the Godot version, the project, the mode and its rules; - the agent streams back text, thoughts, tool calls, diffs and its plan, which the dock renders as they arrive;
-
session/request_permissionasks before acting, and the harness answers according to the permission policy; -
fs/read_text_fileandfs/write_text_filego through the editor, so open scripts and unsaved buffers are respected; -
session/cancelstops a turn (Esc).
The pipes are read on the editor's main thread, without threads, so reloading an addon script never crashes the editor.
The agent also gets the path of the running editor's binary, in $GODOT and in its instructions. When it runs Godot from the command line (--headless, --import, tests), it uses the same version as your editor, not another godot on your PATH.
The harness starts an MCP server on 127.0.0.1, never on another interface, with a Bearer token that changes on every start. It passes the server to the agent when the session opens. If an agent can't do MCP over HTTP, a stdio bridge run by the same Godot binary relays it.
Through it the agent calls the godot.* tools: read the scene tree, edit nodes, run the game, capture frames, read errors. See Editor tools. Each call passes through the permission policy first. Each tool also tells the client whether it only reads, can overwrite or delete, or reaches the internet; text from outside the harness (the game's output, scene texts, Asset Store pages) comes back inside an untrusted envelope; and a call longer than 2 seconds reports progress so the client keeps waiting. See Editor tools → Details.
Claude Code also writes files with its own tools, straight to disk. The harness catches that and updates the editor, so the "modified outside Godot" dialog doesn't appear:
- open scripts are updated in the Script Editor;
- open scenes without unsaved changes are reloaded;
- changes to
project.godot(input actions, autoloads, main scene…) are applied to the editor's project settings, and the editor saves them.
A scene or script with unsaved changes is never overwritten: you get a conflict notice with the diff.
Every session is saved in user://godot_agent/sessions/ once per turn, without images and with long results trimmed. History in the dock lists this project's sessions:
- if the agent supports
session/load(Claude Code does), the session really resumes: the agent gets its context back; - otherwise you see the conversation read-only, and writing starts a new session.
+ in the dock header › New tab opens another session in its own tab (the tab row shows up then), with its own agent, conversation and mode. Each agent can work on its own task in the same editor, and the harness keeps them from stepping on each other:
-
Files: a file one session writes in its turn (with the agent's own edit tools or with the
godot.*tools) is off limits to the others until that turn ends. Another session that tries is rejected, with the name of the session that holds it. -
The game: the session that ran the game keeps it until it stops. Another session's
run_scenewaits in line (up to a minute and a half), and thegodot.game_*tools can't touch a game that isn't theirs. -
A channel between them:
godot.sessionsshows each agent the other sessions, what they're doing, the files they hold and who has the game.godot.session_sendleaves a message for another session, which reaches its agent when its turn ends, as data and not as instructions; you approve each one, and never toward a session with more permissions.
The first tab is the main session: Review annotations and Remote Control use it, and it can't be closed (with other tabs open it shows a pin; to start over, use + → New session). A One-shot run opens its own tab. The other tabs have the Ask, Review, Build and Auto modes, and the project's own project modes. Closing a tab ends its session.
+ also offers New tab in a separate copy (git worktree): the agent works in a copy of the project on a new branch (agent/copy-<date>), created next to the repo (<repo>.godot-agent-copies/) from your last commit, so uncommitted changes aren't in it. It doesn't touch the open editor: it edits files with its own tools and checks them with Godot headless, and the godot.* tools that edit the editor's project or run its game are rejected for it. When you close its tab, what it changed is committed to its branch and you choose: Apply to the project (as uncommitted changes, with git apply; if you changed the same files and it doesn't apply cleanly, the branch stays), Keep the branch or Discard. A copy without changes is removed on its own.
Double-click a tab to rename it (leave it empty to go back to «Session N»). The name is also how the agents refer to that session, so two sessions can't share it. A tab marked ⚠ is waiting for your permission; if it isn't in view, the editor also shows a notice. ● means its agent is working. The agent chip in the header shows the Claude Code account each session is signed in with.
Claude Code reports the usage of your plan's windows (5 hours, weekly and, if your plan has one, the weekly limit of a single model such as Fable). The harness shows it, warns at 75 %, pauses One-shot at 90 % and, when the limit hits, blocks sending with a countdown until the window resets. It doesn't estimate the quota from tokens, doesn't call undocumented endpoints and doesn't read the agent's files. See One-shot → quota.
The bottom panel shows everything by channel:
-
proc: the agent process; -
acp: protocol messages; -
mcp: tool calls; -
fs: file reads and writes through the editor; -
perm: permission decisions; -
quota; -
cmp: completion latencies; -
state: a session, the game launched byrun_sceneor a One-shot run changed state in a way the harness didn't expect. The change still happens; the line names both states.
Secrets (the MCP server's token, the keys the agent and the MCP servers take from the environment) are masked here, and also in the chat, on the permission and error cards, in the saved session history and in the One-shot report; what the agent writes or runs keeps the real value. It's the first place to look when something doesn't work: see Troubleshooting.