A dock panel that runs the real Claude Code agent inside the editor by spawning
the user's installed claude CLI in headless streaming mode. Distinct from the
AI Assistant panel, which is a
bespoke loop over the raw Anthropic API: this is Claude Code itself — it edits
files, runs commands, plans, and uses MCP servers.
Because it runs with cwd = the open project, it inherits the user's Claude Code
auth/config and the repo's .mcp.json — so the
taos-editor MCP server is available automatically. One embedded agent can thus
edit project code/scripts and drive the live scene (create objects, add
components) through the editor MCP bridge.
How it works#
ClaudeCodePanel (renderer)
window.editor.claude.start/send/stop ── IPC ──> main/claude_code.ts
spawns:
claude -p --input-format stream-json --output-format stream-json --verbose
--permission-mode <mode> [--model <m>] --allowedTools mcp__taos-editor
(cwd = project root)
stdout (NDJSON)
onEvent(ClaudeChannelEvent) <── editor:claudeEvent ── parseClaudeLine()- Prompts flow as stdin
{"type":"user","message":{…}}frames (never argv), so the spawn is shell-safe. One process stays alive across turns. - stdout is split per line and normalized by the shared
parseClaudeLineintoassistant_text/thinking/tool_use/tool_result/result/init/rate_limitevents, plus process-lifecycle events (started/stderr/exited/spawn_error).
Using it#
- Open the Claude Code panel (Window ▸ Add Panel, or the dock
+). - Pick a model and permission mode, type a prompt, Enter to send.
Accept edits(default): file edits + safe ops auto-approved.Plan: read-only exploration.Default: tools needing approval are auto-denied (no TTY); surfaced as a denial count on the result line.Bypass: skip all permission checks.
- To have Claude's scene edits render live, Share Project (or enable the MCP auto-host) so the editor is in the collab room the taos-editor tools target.
The taos-editor MCP tools are pre-approved (--allowedTools mcp__taos-editor) so
scene-driving works without per-tool prompts.
Requirements & limitations#
- Requires the Claude Code CLI on
PATH(claude). Aspawn_errorevent with guidance is shown if it isn't found. Note: a GUI-launched Electron app may have a reducedPATHthat omits~/.local/bin— launching the editor from a terminal (or a future explicit-binary-path setting) avoids that. - Web build: not available (no child processes in a browser) — the
claudeAPI is stubbed. - v1 has no in-panel interactive permission prompt; it relies on the permission mode. Intercepting individual tool approvals into the editor UI is a follow-up.
- Token-level streaming (
--include-partial-messages) is parsed (text_delta) but not enabled by default; assistant messages render as whole chunks.