Onlook's Rebuild: Why Agentic UI Design Needs Git Worktrees

Onlook rebuilt its open-source UI tool around Git worktrees, live webviews, and bring-your-own AI agents to bring divergent exploration to real code.

Onlook's Rebuild: Why Agentic UI Design Needs Git Worktrees
In this essay

Onlook, a Y Combinator W25 startup, has open-sourced a complete rebuild of its visual desktop editor under the Apache 2.0 license, trading proprietary AI wrappers for an infinite canvas backed by local git worktree sandboxes and user-connected coding agents. That architectural pivot pinpoints why terminal-based AI coding assistants still feel awkward for interface design: developer tools optimize for convergence on a single branch, whereas good UI work demands divergent, side-by-side exploration.

Convergence vs. Divergence in AI Tooling

Most AI coding workflows inherit the mental model of a software engineer’s terminal. You check out one branch, bind one local port, type a prompt, and iterate linearly toward a clean diff. That setup excels when fixing a bug or implementing a well-specified API endpoint, where every step narrows the solution space.

Product designers work in the opposite direction before narrowing down. Exploring a checkout flow or a pricing page means laying out ten variations at once, viewing mobile, tablet, and desktop breakpoints side by side, and comparing empty, loading, and error states in a single glance. When teams force that messy spatial process into a sequential chat window—or keep drawing static vector mockups in Figma only for engineers to rebuild them from scratch—half the creative bandwidth goes into context switching and translation.

Onlook’s own product detours illustrate how hard this gap is to bridge. Before this release, the team built a browser-hosted version that arrived too early and a Storybook-native version that clashed with how real applications manage state and routing. Meanwhile, their unpromoted July 2024 desktop prototype kept attracting hundreds of downloads every month. Rebuilding around a local-first Electron app—paired with React 19, Bun, and node-pty—lets the tool run a team’s actual application rather than an isolated component sandbox.

Git Worktrees as the Spatial Canvas Primitive

Precision-milled aluminum blocks and optical glass prisms arranged in parallel tracks on concrete

The sharpest engineering decision in the new Onlook is how it maps visual frames on an infinite canvas to real source files without corrupting a developer’s working directory. When pointed at a local folder or imported GitHub repository, Onlook creates isolated git worktree checkouts, spawns the project’s dev server in the background without opening a terminal, and renders each running instance inside a live webview frame.

Under the hood, Git worktrees allow multiple branches of the same repository to sit checked out in sibling directories while sharing a single .git object store:

git worktree add ../wt-compact-card -b design/compact-card
git worktree add ../wt-split-pricing -b design/split-pricing

Instead of stashing uncommitted edits or fighting branch switches every time a designer wants to compare two layouts, each visual experiment gets its own working tree and live preview running against real application data.

To bridge visual clicks and source code, Onlook injects a lightweight inspection script into each rendered frame. Selecting a frame or double-clicking an element draws layout outlines—including Alt/Option distance measurements—and passes exact DOM context to the connected coding agent. Asking the tool to turn a list into a card grid no longer requires pasting file paths into a prompt. Every edit happens directly in repository files, reloads through the local dev server, and lands as a standard Git diff that can open a GitHub pull request in one click. For throwaway ideas that do not belong in the repo yet, an Artifacts mode supports standalone sketches exportable to HTML, PDF, PNG, or JPEG.

Why Bring-Your-Own-Agent Beats Another Wrapper

Equally telling is what Onlook chose not to build this time: its own coding model or metered token proxy. Users connect their existing Claude Code or ChatGPT/Codex accounts, alongside Model Context Protocol (MCP) connectors for external context, and let that agent execute file edits inside the worktree.

For AI devtool startups, this bring-your-own-agent (BYOA) pattern is a pragmatic survival strategy. Reselling frontier LLM tokens inside a thin UI wrapper squeezes margins and locks users into a second subscription for capabilities they already pay Anthropic or OpenAI to use. By offloading code synthesis and dependency troubleshooting to established coding harnesses, a smaller open-source team can focus entirely on the spatial orchestration layer—managing worktrees, mapping live DOM selections to repository files, and translating visual intent into reviewable pull requests.

Practical Bottlenecks Teams Should Weigh

Designing directly on a live codebase eliminates mockup drift, but it introduces systems trade-offs that static vector tools never face:

  • Local resource pressure: Figma can render fifty vector artboards on modest hardware. Spinning up multiple concurrent Git worktrees, dev servers, bundlers, and Electron webviews consumes substantial RAM and CPU, especially on heavy frontend monorepos.
  • Reconciling parallel diffs: Divergence is cheap until three competing pricing-card branches modify the same shared component. While Onlook can ask the connected agent to compare conflicting pull requests and synthesize a unified branch on the canvas, non-trivial structural edits still require engineering review to merge cleanly.
  • Packaging and onboarding friction: Although the repository is Apache 2.0 and building from source requires no Onlook account or cloud keys, the official desktop binary enables usage analytics by default (disabled in settings or via STUDIO_TELEMETRY=0), and early macOS testers reported login hiccups during initial onboarding.

Even with those rough edges, Onlook points toward a healthier division of labor for frontend teams. Rather than pushing designers into terminal CLIs or asking engineers to hand-translate static rectangles, treat the Git worktree—wrapped in a spatial canvas—as the common unit of UI experimentation.

Sources

  1. github.com
  2. news.ycombinator.com
  3. git-scm.com

AI-assisted · Reviewed by PKN

0

Responses

Loading comments…