Claude Bridge — a local HTTP eval server to let an AI coding agent inspect your live SketchUp model

Hello,

Claude Bridge is a small development-only extension I have been using while working on my own extensions, and that I am now making available in case it is useful to others.

It starts a tiny HTTP server on 127.0.0.1:7857 that accepts Ruby source code, evaluates it inside the running SketchUp process, and returns the result as JSON. The idea is to let a local coding agent — in my case Claude Code — or any plain shell script read and manipulate the model you currently have open, without the copy-paste round trip through the Ruby Console.

In practice, I can now ask the agent “why is this face reversed?” or “my solid tool returns wrong on this specific shape, investigate…”, and it inspects the actual model on its own instead of me relaying puts output by hand. It has turned out to be a real time-saver when debugging geometry.

Designating geometry with the Text tool. The part I did not expect to like so much: the plain
Text tool turns out to be a good pointing device for an agent. Attach a leader text to a part, write
what you want in it — “check this joint”, “wrong grain direction” — and the agent can read both the
target and the instruction in one call. It resolves the exact instance you meant, even when the same component is placed twenty times, and even for notes buried inside groups and components. Selection works too, of course, but annotations survive across calls and let you queue up several questions at once before handing the model over.

And of course, it can create new elements and geometries like “make me a cabinet…

Two routes:

  • GET /ping — liveness check, returns the SketchUp and Ruby versions plus the active model
  • POST /eval — the request body is Ruby, evaluated in the SketchUp process; the response carries the value of the last expression and anything the script printed to $stdout
curl -s -X POST -H 'X-Claude-Bridge: 1' \
     --data-binary @script.rb \
     http://127.0.0.1:7857/eval
{ "ok": true, "result": [ [ "Sketchup::Group", 1234 ] ], "stdout": "" }

Requests are served on SketchUp’s main thread through a UI.start_timer tick, which is what makes the SketchUp API safe to call from them — and also means evaluations should be kept short, since a slow script freezes the window until it returns.


:warning: Please read this before installing. This is, by design, an arbitrary code execution server. While it is running, any process on your machine can reach it, and the code it evaluates has the full power of the SketchUp API — including saving, deleting and overwriting your work. It only ever binds to 127.0.0.1, it never auto-starts, every request must carry an X-Claude-Bridge: 1 header, and you start and stop it explicitly from its toolbar button. It is a tool for developers, on a developer’s machine. It is not meant for end users, and it must never be shipped as part of a product.


Feedback and ideas welcome — especially from anyone doing something similar with other agents or editors.

8 Likes