SLOPSHOPPER

gdh

Lets Claude make Godot 4 games: see and drive them off-screen on the GPU, work through the open editor with real UIDs, check scripts and the API, run tests and…

bandprocessnetworktimer
★ 1v0.2.0no licenseupdated 2026-10-22astrosteveo/gdh
A shopper browsing a rack in a slop shop
README

gdh

Renders Godot scenes off-screen on the real GPU and saves screenshots, debug views, engine errors and checks for likely defects. An AI agent or a script can then inspect what the game draws.

It also lets an agent change a project without fighting the Godot editor: a live link into the editor (gdh bridge) for UIDs, script checks and edits the user can undo, plus gdh api for the installed Godot's class reference, gdh test for a project's tests and gdh export for builds.

Linux only for now.

Requirements

  • Linux
  • Godot 4.7 (tested with 4.7.2)
  • A Vulkan driver for your GPU
  • weston and Xwayland, for the display the GPU presents to (Arch: weston xorg-xwayland, Debian/Ubuntu: weston xwayland). Tested with weston 15 and Xwayland 24.1. Older releases may not have what gdh uses (rootful Xwayland, weston's --renderer=gl on its headless backend), and then gdh falls back to Xvfb.
  • Xvfb, the fallback when that display can't start (Arch: xorg-server-xvfb, Debian/Ubuntu: xvfb)
  • uv (it provides Python 3.10+, Pillow and NumPy)
  • For a C# project: Godot's .NET build as godot-mono, and the .NET SDK (dotnet)

C# projects

A project with a .csproj is a C# project. Before capture, live start and import, gdh builds its assemblies with dotnet build, since Godot run from the command line loads them but never builds them. It builds only when a .cs, .csproj, .sln or props/targets file changed since its last build, so don't build by hand first; --rebuild forces a build. It runs godot-mono unless GODOT names another binary. A failed build stops gdh with the compiler's errors. --no-build skips the build.

C# objects are invisible to eval unless the game hands them over as Godot values, so give the project a node or autoload with methods that return dictionaries and arrays.

Importing

Godot run from the command line, as gdh runs a game, never imports assets. A texture or model whose imported copy in .godot/imported is missing fails to load, and the game draws without it, so a fresh checkout or worktree renders with missing textures. A changed asset with a stale copy draws as it was. So before capture and live start, gdh checks the project's import cache and imports it (godot --headless --import) when it's missing or stale, and says why on stderr. The check reads file times only, and hashes an asset only when it's newer than its import (a checkout touches files without changing them), so it costs next to nothing when nothing changed; a Godot import costs a couple of seconds. It counts as stale when .godot or .godot/uid_cache.bin is missing, an importable asset has no .import file, an imported copy named in an .import file is missing, an asset's content changed since its import, or a script's class_name is missing from Godot's class cache. An asset Godot can't import is remembered and skipped, and every other asset is still checked. A change to an asset's import settings alone isn't detected: run gdh import. --no-import skips the check. The import's editor settings and caches are gdh's, as gdh editor's are, kept apart for each Godot binary (docs/editor.md), so it never rewrites yours, and the standard and .NET builds never read each other's. gdh editor needs none of this: it runs the editor, which imports as it opens.

Resources that still fail to load (Failed loading resource, Error loading resource, No loader found for resource, a scene's [ext_resource] referenced non-existent resource, a missing .ctex) are a defect, not log noise: capture prints a DEFECT: line naming them and lists them in report.json under missing_resources, and live prints the same line on stderr, with the errors of the command that raised them.

Window size

--resolution sets the game's window. gdh checks the window's real size once the game has started (DisplayServer.window_get_size()), since a game can size its window itself, from a saved setting say. If it isn't the size asked for, capture saves what it got and exits 1 with the size it found (also in report.json under size_mismatch), and live start stops the game and says so. A game that resizes its window later in a live session gets a note on the next step. The window is what's compared: under stretch mode viewport the screenshots are at the project's base size whatever the window is.

Install

From a clone of this repo:

uv tool install .

This puts gdh on your PATH. After pulling changes, run uv tool install --reinstall ..

To run it from the repo without installing, use uv run gdh ....

gdh guide prints a one-page cheat sheet of the commands that save an agent the most calls, for an agent that has gdh but not the plugin below.

Claude Code plugin

The repo is also a Claude Code plugin. To try it without installing:

claude --plugin-dir /path/to/gdh

To install it from GitHub (astrosteveo/gdh, private for now, so you need access to it):

/plugin marketplace add astrosteveo/gdh
/plugin install gdh@gdh

It runs gdh from the plugin's own copy of this repo, so uv is the only extra install. It holds:

PartWhat it does
gdh skillWhen and how to see and drive the game: which mode to pick, how to read the views and crops, how to drive a live session, what to report
godot-editor skillChanging a project with the editor open: the bridge, live edits the user can undo, UIDs
godot-gdscript, godot-project, godot-export skillsTyped Godot 4.7 GDScript and its Godot 3 pitfalls; scenes, autoloads, the Input Map and saves; exporting builds
playtester agentPlays a scene with gdh live against a goal and reports pass or fail with evidence, keeps each passed goal as a scenario, and leaves notes for the next playtest
HooksBefore each Write or Edit in a Godot project: refuse edits to .godot/, to scenes with unsaved changes in the editor, to project.godot under a running editor, and uid:// values the project doesn't have. After: rescan the file, reload it if it's open, fill in a new scene's UIDs and check GDScript, returning Godot's errors. GDH_HOOKS=off turns them off.
BandA row above Claude Code's prompt in a Godot project. With the bridge running, it shows the open scene, unsaved scenes, the running game and editor errors waiting for Claude. With no bridge it shows nothing, unless a Godot editor has the project open: then it warns that saving there can overwrite Claude's edits.

With or without the Godot editor open

You can work with Claude either way, and you don't need Godot open at all.

  • Without the editor. Claude edits the project's files and checks its work by rendering and playing the game off-screen. You need nothing else.
  • With the editor open beside Claude. Use this to watch scenes change, adjust things by hand or run the game yourself. The editor keeps open scenes in memory, so without help it can overwrite Claude's edits when it saves, and Claude's edits can overwrite your unsaved work. The bridge fixes that: it's a small addon that lets Claude make its changes through the editor. Set it up once per project, by asking Claude or with:
  gdh bridge install --project path/to/game

Then enable gdh bridge in Godot under Project > Project Settings > Plugins. From then on, whenever the editor is open, Claude's edits reload open scenes instead of replacing them, your unsaved changes are protected, and the editor's errors come back to Claude. The addon is a development tool, so you can add addons/gdh_bridge/ to .gitignore.

The band shows a warning when a Godot editor has the project open without the bridge, the one case where the bridge matters. gdh bridge start is for Claude: it runs a headless editor with the bridge so Claude can look up UIDs and make editor edits when you don't have Godot open.

Capture a scene

gdh capture --project path/to/game --scene res://levels/level_1.tscn --out captures/level_1

Arguments after -- go to the game, and OS.get_cmdline_user_args() returns exactly them:

gdh capture --project path/to/game --scene res://main.tscn --out captures/main -- --level 3

Nothing is installed into the project. For each scene, the output directory gets these files:

FileContents
normal.pngThe frame as the player sees it
unshaded.pngBase colors with lighting off
lighting.pngLighting only
normals.pngSurface directions (normal buffer)
wireframe.pngTriangle edges
overdraw.pngHow many times each pixel is drawn
report.jsonGPU used, display, window and image size, engine errors and warnings, resources that failed to load, render stats, probe findings
crops/A zoomed crop for each finding that has a screen area
godot.logFull engine output
display.logThe display's own output (weston and Xwayland, or Xvfb)

Options:

OptionDefaultMeaning
--scenerequiredScene to capture. Repeat it to capture several scenes, each in its own subdirectory.
--modesall sixComma-separated list of views, e.g. normal,wireframe
--locale CODEthe project'sTranslate the game's text to this locale, or pseudo: every text 40% longer with accents, so the text_overflow probe finds what won't fit (docs/probes.md)
--warmup30Frames to render before capturing
--resolution1280x720The game window's size, checked once the game has started (Window size)
--displayautogpu, xvfb or auto (Displays)
--timeout120Seconds allowed per scene
--tilesoffAlso save normal.png as four 2× tiles in crops/
--baseline DIRoffCompare each view with the PNG of its name in DIR (a subdirectory per scene, as --out), report a changed view as a finding with a crop, and exit 1 when one changed past --tolerance (docs/measure.md)
--update-baselineoffWrite the views into --baseline DIR instead
--tolerance PCT0With --baseline: the percent of a view's pixels that may change
--threshold T2With --baseline: a pixel has changed when a channel differs by more than T (of 255)
--matrix [SCREENS]offCapture at each screen (16:9, 21:9, 4:3, deck, phone and more, or WxH) by each --quality, each into a directory of its own, and lay them out in matrix.png (docs/compare.md)
--quality PRESETSprojectWith --matrix: project, low, medium, high, comma-separated: rendering settings for each run
--set SECTION/KEY=VALUEnoneWith --matrix: a project setting for every cell; repeatable
--no-importoffDon't import the project first when its import cache is missing or stale (Importing)

Environment variables:

VariableMeaning
GODOTPath to the Godot binary. Default: godot-mono for a C# project, godot otherwise.
GDH_GPU_INDEXVulkan device index to render on. Default: Godot picks one.
GDH_DISPLAYThe display when --display isn't given: auto (the default), gpu or xvfb.

Drive a running game

gdh live start --project path/to/game
gdh live step 30 --hold ui_right --shot
gdh live eval "get_node('Player').position"
gdh live stop

gdh live starts the game off-screen, held at frame 0, and runs it an exact number of frames per step. Steps can inject actions, keys and shortcuts, clicks, drags, typed text (--type), the wheel, a gamepad's buttons and sticks, touches and mouse-look. Between commands you can save frames in any view, run the probes, inspect the scene tree and evaluate expressions.

Most checks take one command:

gdh live step --until "scene.name == 'Hangar'" --max 1200   # run until it holds, or exit 1
gdh live step 120 --trace "get_node('Ship').position.y"       # a value, frame by frame
gdh live find Play                                             # what shows "Play", and where
gdh live step 2 --click-text Play                              # click it, no coordinates
gdh live shot --node UI/Inventory --zoom 2 --out inv.png       # that part of the frame, zoomed
gdh live shot --annotate all --filter class:Enemy               # each node boxed and named, shapes, nav, velocities
gdh live pick 640,360                                           # what's drawn at that pixel, topmost first
gdh live batch --session s < commands.txt                      # many commands, one process

After a code change, gdh live reload loads changed GDScript into the running game with its state kept, and gdh live restart --replay starts the session again with the same options and companions and replays its input log back to the same frame. start --recipe FILE runs lines written as for batch once the game is ready (a project's "get to the hangar"), --seed N makes the global random numbers repeat, and --user-data fresh or --user-data-from DIR give the session a user:// of its own.

start --net NAME puts a companion behind gdh's network proxy, and gdh live net adds latency, jitter and packet loss, cuts and heals one instance's link, or resets its connections, to test a multiplayer game's lag, desync and reconnects. gdh live snapshot prints the UI on screen as a text outline, each text, button, field and slider with its state, and compares it with a baseline file, a check that doesn't depend on pixels. start --timeline keeps a record of the session to look through afterwards, as Playwright's trace viewer does: <out>/timeline/index.html lists every command with its frames, errors, notes and values, and a thumbnail of the frame after it. A game that calls GdhEvents.emit(name, data) (gdh events install adds the autoload) has its events printed with their frames as they happen, and gdh live events lists, counts and charts them. --click-text and --click-node fail without stepping when something else would take the click, such as a transparent panel left over a button, and say what it is.

Results go to stdout. Engine errors (with a script's backtrace), DEFECT: lines, notes and what the game printed go to stderr, so they survive a discarded stdout; --strict exits 1 when the game raised engine errors. gdh live list lists every session.

A session can also start companion processes beside the game, such as a server, wait until they're ready, hand their ports to the game and stop them with it, and it can run several instances of the game that step together. A script can drive it over one pipe:

gdh live start --project path/to/game --instances 2 \
  --companion 'server=exec ./server --port {port}' -- --connect 127.0.0.1:{server.port} --name player{instance}
gdh live step 60 --hold move_right --instance 1
gdh live eval "get_node('Player').position" --instance all
gdh live pipe < requests.jsonl

Processes the game spawns (a launcher's game, a tool) are listed by gdh live status and end with the session. gdh live start --keep-children keeps the session and its display until they have ended too, for a launcher that hands off to the game and exits, or until the idle timeout passes with no gdh live command on the session; the harness stays in the game gdh started, so a handed-off game can be watched but not stepped.

See docs/live.md.

See what the editor shows

gdh editor --project path/to/game --scene res://levels/level_1.tscn --out captures/editor
gdh editor --project path/to/game --scene res://levels/level_1.tscn --out captures/editor --zoom 30 --orbit=-150,40
gdh editor --project path/to/game --scene res://levels/level_1.tscn --out captures/editor --view 0,40,80:0,0,0 --far 5000

gdh editor opens scenes in the Godot editor itself, on a display of gdh's own, and saves what the editor shows. Godot runs as godot --editor --script <gdh's harness>, so the editor starts as it does for a person, with the project's tool scripts, plugins and importers, and gdh's harness as its main loop: nothing is installed into the project. For each scene the output directory gets:

FileContents
viewport.pngThe editor's first 3D viewport (or its 2D one), as the editor draws it: the scene, the grid and the gizmos
editor.pngThe whole editor window: the docks, the inspector, the viewport and its menus
report.jsonErrors and warnings while the scene opened and after, how long it took to open, how often the editor redrew over idle seconds, what one redraw of the viewport costs, the camera, and the scene's nodes with how many tool scripts made under each

Beside them, editor.json holds the startup (how long the editor took to be ready, its errors) and project_changes: files outside .godot that the editor wrote in the project (Godot often rewrites project.godot in its own format). gdh lists them and leaves them as they are. godot.log and display.log are the engine's and the display's output.

Options:

OptionDefaultMeaning
--scenerequiredScene to open. Repeat it to open several in one editor run, each in its own subdirectory.
--resolution1600x900The editor window's size
--warmup60Frames to wait after a scene opens
--idle2Seconds to count the editor's redraws while nothing happens
--orbit DX,DYTurn the 3D view as dragging with the middle button does (write --orbit=DX,DY for a negative DX)
--zoom STEPSZoom the 3D view as the mouse wheel does: out, or in when negative
--focus NODECenter the 3D view on a node, as the View menu's Focus Selection does; in a 2D scene, frame it (Frame Selection)
--rebuildoffBuild a C# project's code again with the scene open and give the editor the focus so it loads the new build; saves viewport-rebuilt.png
--saveoffSave each scene through the editor after capturing it; the report says whether the file changed
--view X,Y,Z:X,Y,ZLook from the first point at the second, through a camera gdh adds and previews (never saved)
--farthe editor camera'sThe --view camera's far plane
--set NODE:PROPERTY=VALUESet a property before capturing, in memory only; repeatable. The value is read as Godot's syntax; a res:// path is that resource, loaded; anything else is plain text
--select NODESelect a node, so the inspector shows it
--display, --timeout, --no-buildAs for capture

NODE is a path from the scene's root (. is the root). The editor's settings, data and caches live in ~/.local/share/gdh/editor-home (GDH_EDITOR_HOME picks another; the settings and caches apart for each Godot binary), never your own, and the project's .godot/editor (its layout, recent scenes and each scene's camera) is put back as it was. See docs/editor.md.

Measure what it draws

gdh measure puts numbers on frames, any game's: flicker on a still camera, shimmer on a moving one (the second difference over time), a light's jitter, what one setting adds, a thin line's width and brightness, the size of each point of light (stars, dust), doubled or empty pixels in a dissolve, black from a NaN, crushed blacks, and frame times. A live session records the frames, or measures as it goes, and records each frame's GPU time and, with --gpu-passes, each render pass's.

gdh live record 120 --session s --out frames/still       # 120 frames, each saved
gdh measure flicker frames/still                          # every pixel's change over them
gdh measure line frame.png --from 400,120 --to 400,580    # a line's width at half its height
gdh measure spots frame.png --radius 6                     # each star's or mote's width at half its peak, and sigma
gdh live measure black --frames 60 --fail --session s     # black cut into something lit: a NaN
gdh live start --project game --session s --gpu-passes    # time each render pass too
gdh live bench 600 --budget-p99 8.3 --session s            # time 600 frames in one call; exit 1 over budget
gdh live profile 600 --session s                           # with start --profiler: which script functions took the time
gdh live monitors --leak --session s                       # nodes, orphans, objects, memory: exit 1 on steady growth
gdh live audio --session s                                 # each bus's peak over the last step, and what played
gdh measure audio captures/clip/movie.mp4                 # its waveform and spectrogram, marked in frames; clipping
gdh measure sheet frames/still --out still-sheet.png      # 16 frames of a run (or a video) in one image
gdh measure diff before.png after.png --out diff          # what changed: share, box, heatmap, amplified crop

A recording (live record, live measure) also writes a contact sheet beside its frames' directory and flags a UI panel that covered the middle of the screen for most of it (docs/movie.md).

See docs/measure.md for each measure's definition and limits.

See motion

An image reader sees one still frame at a time. These turn motion over many frames into one image, from a live session (stepped with any of step's input) or from saved frames:

gdh live step 90 --hold ui_accept --trace "get_node('Player').position" --trace-chart jump.png --trace-rates
gdh live onion 40 --node Player --hold ui_right --session s     # the frames laid over each other, oldest faintest
gdh live step 60 --trail Player --every 5 --session s           # its path on the last frame, a dot every 5 frames
gdh live filmstrip 24 --node Player --session s                 # the same box from each frame, side by side
gdh measure changes frames/idle --out idle-changes.png --still  # where a run changed, and how often

A trace chart shows values over time, with velocity and acceleration. An onion skin shows a movement's path, spacing and shape. A trail shows the path through the world even when the camera follows the node, and prints the pixels between its dots, so easing and overshoot show as numbers. A filmstrip shows a pose, a flash or a transition frame by frame. A change map shows what moved in a scene that should be still, and what stayed frozen that should move; gdh live record writes one beside each recording. See docs/motion.md.

Measure game feel

gdh live latency --press ui_accept --watch "get_node('Player').velocity.y" --node Player --session s
gdh live feel --node Player --session s           # top speed, stopping, jumps, coyote time, jump buffer
gdh live hitstop --do "get_node('Player').take_hit(10)" --hold ui_right --node Player --session s
gdh live shake --press attack --session s
gdh live follow --target Player --hold ui_right --session s
gdh live soundsync 600 --hold ui_right --event footstep_contact --session s   # each footstep's sound, in frames

Feel is mostly timing, and these put numbers on it: the frames from an input to the game's state and to the pixels, a character's top speed and the time to it, stopping, a jump's height and airtime, air control, the coyote time and jump buffer (found by pressing at each frame offset), how long a hit-stop freezes time, a camera shake's size, frequency and decay, how far a camera lags, and how many frames each sound comes after what it belongs to. Each draws a chart. See docs/feel.md.

Check animation and art

gdh live anim 120 --node Player --hold ui_right --session s     # states, positions, blends; restarts and flip-flops
gdh live footslide 120 --skeleton Player/Skeleton3D --session s  # p
Source 2 files
hooks/register.tsx 161 lines
1import { atom, read, update } from 'claude-code'
2import type { EngineInterface, Register } from 'claude-code'
3
4import type { GodotView } from '../types'
5
6// A band above the prompt for a session in a Godot project. With a bridge running it shows which scene is open, which
7// have unsaved changes, whether the game runs, and how many editor errors wait for Claude's next bridge command; it
8// reads the bridge with a peek, which leaves those errors for Claude. With no bridge it shows nothing, unless a Godot
9// editor has the project open: then saving there can overwrite Claude's edits, and the band says how to add the bridge.
10
11const view = atom({ plugin: 'gdh', key: 'view' } as const, { kind: 'none' } as GodotView)
12const hidden = atom({ plugin: 'gdh', key: 'hidden' } as const, false)
13const POLL_MS = 3000
14
15type BridgeInfo = { port: number; token: string }
16type BridgeStatus = {
17  ok: boolean
18  godot: string
19  headless: boolean
20  current_scene: string
21  unsaved_scenes: string[]
22  playing: boolean
23  playing_scene: string
24  pending_errors?: number
25}
26
27const parent = (dir: string) => dir.replace(/\/[^/]+\/?$/, '') || '/'
28
29async function findProject($: EngineInterface, start: string): Promise<string | null> {
30  let dir = start
31  for (let i = 0; i < 40; i++) {
32    if (await $.fs.exists(`${dir}/project.godot`)) return dir
33    const up = parent(dir)
34    if (up === dir) return null
35    dir = up
36  }
37  return null
38}
39
40const short = (res: string) => res.replace(/^res:\/\//, '')
41
42// Whether a Godot command line opens the editor: `-e`/`--editor`, or a project.godot path. A game, the project manager
43// and a headless Godot (gdh's own, among others) don't count.
44function opensEditor(argv: readonly string[]): boolean {
45  const args = argv.slice(1)
46  return !args.includes('--headless') && args.some(a => a === '-e' || a === '--editor' || /(^|\/)project\.godot$/.test(a))
47}
48
49// Whether a Godot editor on this machine has the project open, from each Godot process's command line and working
50// folder under /proc: Godot moves into the project's folder as it starts. Elsewhere (no /proc) it answers false, which
51// shows nothing.
52async function editorOpen($: EngineInterface, project: string): Promise<boolean> {
53  const real = async (path: string) => (await $.fs.stat(path, { resolve: true })).realPath ?? path
54  const { stdout } = await $.process.run(['ps', '-Ao', 'pid=,comm='], { timeoutMs: 5000 })
55  const pids = stdout.split('\n').filter(line => /godot/i.test(line)).map(line => line.trim().split(/\s+/)[0])
56  if (pids.length === 0) return false
57  const want = await real(project)
58  for (const pid of pids) {
59    try {
60      const argv = ((await $.fs.read(`/proc/${pid}/cmdline`)) as string).split('\0').filter(a => a !== '')
61      if (opensEditor(argv) && (await real(`/proc/${pid}/cwd`)) === want) return true
62    } catch {
63      // The process ended, or isn't ours to read.
64    }
65  }
66  return false
67}
68
69async function poll($: EngineInterface, project: string | null): Promise<void> {
70  if (project === null) return
71  let next: GodotView | null = null
72  try {
73    const info = JSON.parse((await $.fs.read(`${project}/.godot/gdh_bridge.json`)) as string) as BridgeInfo
74    const res = await $.http.fetch(`http://127.0.0.1:${info.port}/`, {
75      method: 'POST',
76      headers: { 'Content-Type': 'application/json', 'X-Gdh-Token': info.token },
77      body: JSON.stringify({ cmd: 'status', peek: true }),
78    })
79    const s = JSON.parse(res.text) as BridgeStatus
80    if (s.ok) {
81      next = {
82        kind: 'bridge',
83        project,
84        godot: s.godot,
85        headless: s.headless,
86        current: s.current_scene,
87        unsaved: s.unsaved_scenes,
88        playing: s.playing ? s.playing_scene || 'the main scene' : null,
89        errors: s.pending_errors ?? 0,
90      }
91    }
92  } catch {
93    // No info file, or no editor answering it: no bridge.
94  }
95  if (next === null) {
96    let open = false
97    try {
98      open = await editorOpen($, project)
99    } catch {
100      // No ps: show nothing.
101    }
102    next = open ? { kind: 'editor-without-bridge', project } : { kind: 'none' }
103  }
104  const before = JSON.stringify(await read($, view))
105  if (JSON.stringify(next) !== before) await update($, view, () => next)
106}
107
108
109export const register: Register = on => {
110  let project: string | null = null
111
112  on('session.start', async ($, e, next) => {
113    const result = await next(e)
114    project = await findProject($, await $.session.root())
115    if (project !== null) {
116      await poll($, project)
117      $.clock.every(POLL_MS, () => poll($, project))
118    }
119    return result
120  })
121
122  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
123    const v = await read($, view)
124    if (e.props.hasSurvey || v.kind === 'none' || (await read($, hidden))) return next(e)
125    const { Box, Button, Text } = $.ui.resolve(e)
126    const hide = <Button key="hide" label="Hide" onPress={() => update($, hidden, () => true)} />
127    const row =
128      v.kind === 'editor-without-bridge' ? (
129        <Box>
130          <Text color="yellow">
131            The Godot editor has this project open without the gdh bridge, so saving there can overwrite Claude's edits.
132            Ask Claude to set up the bridge, or run gdh bridge install and enable gdh bridge in Project Settings {'>'}{' '}
133            Plugins.{' '}
134          </Text>
135          {hide}
136        </Box>
137      ) : (
138        <Box>
139          <Text dimColor>
140            Godot {v.godot.replace(/-.*/, '')} · {v.headless ? "gdh's headless editor" : 'editor'}
141          </Text>
142          {v.current ? <Text dimColor> · {short(v.current)}</Text> : null}
143          {v.unsaved.length > 0 ? <Text color="yellow"> · unsaved: {v.unsaved.map(short).join(', ')}</Text> : null}
144          {v.playing ? <Text color="green"> · ▶ {short(v.playing)}</Text> : null}
145          {v.errors > 0 ? <Text color="red"> · {v.errors} editor error{v.errors === 1 ? '' : 's'}</Text> : null}
146          <Text> </Text>
147          {hide}
148        </Box>
149      )
150    // The band holds one tree, so draw this row above what the hooks beneath draw rather than in its place: other mods'
151    // bands stay visible without the person hiding this one first.
152    const below = await next(e)
153    return (
154      <Box flexDirection="column">
155        {row}
156        {below}
157      </Box>
158    )
159  })
160}
161
types/index.d.ts 24 lines
1/**
2 * What the Godot band shows: nothing, a warning that a Godot editor has the session's project open without the bridge,
3 * or the state of the bridge's editor.
4 */
5export type GodotView =
6  | { kind: 'none' }
7  | { kind: 'editor-without-bridge'; project: string }
8  | {
9      kind: 'bridge'
10      project: string
11      godot: string
12      headless: boolean
13      current: string
14      unsaved: string[]
15      playing: string | null
16      errors: number
17    }
18
19declare module 'claude-code' {
20  interface PluginState {
21    gdh: { view: GodotView; hidden: boolean }
22  }
23}
24