Herdr App in depth: herdr-core architecture, libghostty, GPUI mods, and a TUI-style workflow

Technical deep dive into the new native Herdr desktop application: how it combines herdr-core, libghostty, GPUI, and QuickJS so every panel is an agent-editable mod without giving up tmux keybindings or keyboard control.

AI-assisted translation, approved by Mateo.

Editorial illustration of Herdr distributing work among several coding agents.

When we published our launch News on the native Herdr app, the first question for anyone already using its terminal interface or tmux was the exact one Typecraft raises in his video I LOVE the herdr desktop app: why move from a fast, keyboard-driven TUI to a desktop GUI?

The answer lies in how the application is built. Far from being a closed web wrapper, Herdr App (herdr-app, released under the Apache 2.0 license for Linux, macOS, and Windows) decouples the process server from the graphical window, embeds the Ghostty terminal engine, and exposes its entire interface as JSON files and small JavaScript programs that users or their coding agents can inspect and rewrite live.

The Board and Code screenshots and two clips come from Herdr's official interactive demo with sample content, not live agent runs. Further down, community authors' published previews have their own credits: those are not our installations or hands-on tests either.

Overview of Herdr's official interactive demo with sample content; it is not a real workspace or session.Enlarge image
Screenshot of the official interactive demo on Herdr's homepage, using sample content; it does not show a real workspace or session.

Two-layer architecture: herdr-core and herdr-app

The design splits the product into two binaries with strict responsibilities:

  • herdr-core (hc): the background runtime that spawns and keeps terminals and agents alive outside the window's lifecycle. It draws nothing on screen and does not depend on the graphical client staying open.
  • herdr-app: a native Rust client that connects to herdr-core, organizes work into spaces, tabs, and panes, and renders the window with GPU acceleration.

When we start a task or an agent with hc run --bg, the process lives inside herdr-core. If we close the Herdr window, restart the interface after an update, or switch layouts, the agents keep running. For terminals attached to an app pane, Herdr enables core retention (keep: true): if the server restarts or the machine recovers from a crash or reboot, kept panes preserve their slot and open a fresh shell in their last known working directory without blindly re-running the old command.

The protocol between the two components is open as well: hc schema prints the full request/response specification as OpenRPC with JSON Schema, and hc connect carries that protocol over standard input and output, including across SSH tunnels.

Terminal engine and native rendering: libghostty, GPUI, and QuickJS

One of the strongest technical points Typecraft highlights when comparing the desktop app to his daily terminal setup is that Herdr is neither an Electron app nor a makeshift HTML terminal emulator. Looking at the official 0 repository, the stack rests on three core components:

  • Terminal emulation via libghostty: the internal ghostty-sys crate links directly against the Ghostty engine. As a result, every pane supports modern ANSI sequences, alternate-screen programs, native scrollback, negotiated Kitty keyboard protocol modes, and smooth execution of demanding TUI tools such as btop, Neovim, or even a nested tmux session.
  • Native GPU interface on GPUI: the window runs on GPUI (gpui-pre and gpui-kit), the GPU-accelerated UI framework using native backends for Linux (Wayland and X11 over Vulkan/wgpu), macOS, and Windows, paired with taffy for flexbox layout calculation.
  • QuickJS JIT mods: every UI panel is written in JavaScript using gpui-kit (gpui-shell) on top of quickjs-jit-runtime. There is no DOM, no CSS, and no WebView: the script describes native GPU elements (div(), flex containers, .on_click handlers) and Rust draws them directly on the GPU.

The repository also maintains targeted patches on top of GPUI and QuickJS so idle windows stop waking on every vsync tick and mods returning many small objects per frame avoid unnecessary call-feedback copies on the main thread.

Status from the source via OSC 7501 and multi-agent delegation

Instead of scraping terminal text or hardcoding a list of known agent brands, herdr-core implements OSC 7501, the open *Program Status Protocol*. Any coding agent or custom script can report its state by emitting a standard ANSI escape sequence to the terminal, such as printf '\e]7501;state=blocked:app=my-agent\e\\'.

Four states drive the visual indicators and navigation order across the app:

  • Blocked: the agent is paused waiting for user input or approval.
  • Done: the agent finished while the user was looking at another tab or space; it transitions to idle automatically once viewed.
  • Working: the agent is actively running tasks or tools.
  • Idle: the agent is inactive or its completed output has already been seen.

Each tab and space derives its aggregate indicator from the most urgent status among its agents (blocked > done > working > idle).

A glance makes the idea clear: a board can group agents by status instead of making us inspect every terminal. The official Board sample illustrates that organization; it does not prove agents are running behind it.

Board view from Herdr's official interactive demo with sample content; it is not a real workspace or session.Enlarge image
Board result in Herdr's official interactive demo, using sample content; it is not a real workspace or session.

Short demo — Board (about 10 seconds, silent): watch the layout selection and the sample reorganizing into columns. This is a visual transformation on the official website, not a mod being installed in the app.

Short silent capture of Herdr's official interactive demo with sample content: selecting Board, transforming the sample, and showing the resulting board. It is not a real workspace or session.

When an agent needs to delegate work, it can read the built-in manual in one pass via hc --skill and spawn helper agents with hc run. The core records the starter as parent and attaches the sub-agent to the parent's tab without cluttering the split layout with new panes. The parent agent can wait with hc wait, inspect output with hc read, or steer the helper with hc send, while from the UI we can inspect any worker in a floating peek overlay (terminal.peek, or Ctrl+click / Cmd+click on a live address like t7 or vps/t7) or promote it to a full pane with terminal.keep.

External terminals can also join the workspace: any process started with hc run --keep --label herdr.space=<id> --label herdr.tab=<id> is automatically adopted into the matching space and tab.

Homelab and remote SSH machines in a unified sidebar

For developers splitting work across a laptop, a desktop workstation, and homelab servers, Herdr integrates remote machines without requiring separate windows. Adding a host via hc machine add user@server or from the app's machine settings connects over SSH to the remote herdr-core instance:

  • Processes, repositories, and environment variables stay on the remote machine.
  • Each machine stores its own document of spaces, tabs, and splits in its own core.
  • The local sidebar brings spaces and agents from every connected machine into a single list, qualifying remote terminal addresses with a <machine>/<id> prefix.
  • Closing the laptop or losing connectivity leaves remote agents running so they can resynchronize when the connection returns.

Bringing TUI and tmux ergonomics into the native app

The main reason terminal-first users like Typecraft end up switching to the graphical app is that it never forces mouse navigation. The ~/.config/herdr-app/keys.json file lets you bind shortcuts by scope (global, terminal, layout:<name>, or mod:<name>) and configure leader key sequences that mirror tmux or Herdr TUI:

  • Split the active pane to the right (pane.split:right) or below (pane.split:down).
  • Toggle the left sidebar (ctrl-shift-b) to focus exclusively on terminal panes.
  • Toggle per-space contextual panels on demand, such as the directory tree (files) or the Git diff viewer (changes).
  • Pass typed JSON arguments to any app command, such as {"command": "layout.resize", "args": {"id": "sidebar", "px": 240}}, or send raw escape sequences directly to the focused terminal via send:<text>.

At the same time, an important architectural boundary remains: Herdr App and Herdr TUI still run on separate backends. As a project contributor confirmed in issue #63, the desktop app uses herdr-core (hc) while the TUI runs its own server, meaning they cannot share live sessions and the session import request in issue #96 is still open. The parity today comes from replicating TUI keybindings, libghostty performance, and workspace navigation inside the native client rather than attaching both interfaces to the same daemon.

The whole interface as files: layouts, mods, and safe agent editing

Inside ~/.config/herdr-app, nothing in the default window uses privileged internal UI code. The spaces sidebar, the agents list, the tab bar, pane headers, menus, and toast notifications are all mods built with the same public APIs available to users:

  • layouts/<name>.json: defines the full window tree using row, column, stack, and block nodes, plus floating blocks that can act as edge-peeking drawers (peek), cascading themes, custom .ttf/.otf fonts bundled inside a mod's fonts/ folder, terminal_opacity, and pane frames.
  • mods/<name>/: holds each panel's reactive JavaScript code, with access to spaces(), tabs(), panes(), terminals(), agents(), atomic shared state (shared / setShared), command execution (exec and hc), and directory watchers (watchFolder).
  • defaults/AGENTS.md, herdr.d.ts, and gpui-kit.d.ts: on every launch, Herdr writes the complete customization guide and exact TypeScript definitions for the running version into the config folder. Pointing Claude Code, Codex, or another agent at ~/.config/herdr-app/AGENTS.md gives it everything needed to reshape the app.
Code view from Herdr's official interactive demo with sample content; it is not a real workspace or session.Enlarge image
Code result in Herdr's official interactive demo, using sample content; it is not a real workspace or session.

Short demo — Code (about 11.5 seconds, silent): the same demonstration changes to a code-focused arrangement. The important difference is not a color theme: it changes where each panel sits and which information is within reach.

Short silent capture of Herdr's official interactive demo with sample content: selecting Code, transforming the sample, and showing the code-focused result. It is not a real workspace or session.

To prevent experiments from breaking a working setup, Herdr builds in several safety mechanisms:

  • Read-only shipped defaults: built-in layouts and mods (main, terminals, win98) are refreshed on every start. To customize structure or code, you clone them first with herdr-app do layout.clone or herdr-app do mod.clone (and if you edit a shipped file directly, the next launch moves your changes to <name>-edited and restores the shipped file).
  • Live hot-reload with last-good fallback: saving a layout, keymap, or mod updates the window within a second. If an edit is invalid, Herdr keeps the last working version on screen and writes the diagnostic to <name>.error.
  • CLI verification and GPU frame capture: agents can validate a mod's initial render with herdr-app check <mod-folder>, inspect window state via herdr-app status, and save the last rendered GPU frame as a PNG using herdr-app shot—even when the window is covered or minimized, without needing OS screen-recording permissions.
  • Unbindable escape hatch: Ctrl+Alt+Shift+Escape cannot be overridden by keys.json; pressing it sets aside the active layout and keymap (*.reset-<time>) and returns immediately to the default main layout.

This architecture explains the rapid growth of community creations in the official Herdr Gallery and across social media:

  • Workflow-focused layouts: from Shepherdr, Herdr T3, Cockpit, and Kanban status boards to status bars tracking remaining Claude and Codex quota, lazygit panels, Markdown preview panes, and rule-driven agent folders.
  • Retro and experimental shells: alongside the built-in Herdr 98 desktop layout (which ships its own pixel fonts under mods/win98/fonts/), community builders have created NeXTSTEP, classic Macintosh, and Bloomberg-inspired layouts, Herdr Zoo, and the custom retro pixel-art sidebar Typecraft built with Claude in his video—where animated icons react to each agent's live state and group agents by homelab machine.

Shepherdr: from terminals to a task center

Shepherdr by eliasstravik combines spaces, a chat assistant and a task panel. Its description explains that each task can have its own agent and worktree. The preview shows the arrangement; we do not use it as proof of execution or isolation. Repository and recipe.

Shepherdr community preview: spaces on the left, assistant chat in the middle and tasks on the right; the blur is part of the author's original.Enlarge image
Shepherdr by eliasstravik: chat and tasks in one window. Preview from the repository linked by Herdr's gallery, not our installation; the original blur is preserved.

NeXTSTEP: replace the whole composition

NeXTSTEP by cunderw reorganizes Herdr with a vertical menu, terminal windows and a dock for spaces and agents. It makes clear why a layout goes beyond changing fonts or colors. Repository and recipe.

Community preview of NeXTSTEP for Herdr with a vertical menu, gray-framed terminals and a dock on the right.Enlarge image
NeXTSTEP by cunderw: changes the window structure, not just its colors. Preview from the repository linked by Herdr's gallery; it is not our installation.

Pixel Spaces: start with a small change

Pixel Spaces by pilmokim keeps the rest of the experience and changes the sidebar with per-space sprites and a bell for agents awaiting attention. It is not Typecraft's design: it shows another way to use the same flexibility without rebuilding the whole window. Repository and recipe.

Pixel Spaces sidebar preview for Herdr with colored sprites for each space and a bell showing one notification.Enlarge image
Pixel Spaces by pilmokim: a focused sidebar customization. Community preview, not our installation or Typecraft's layout; its original 640-pixel width is preserved.

All three previews were preserved from identified repository revisions, with proportional derivatives and no cropping. Attribution and licenses are retained for Shepherdr, its third-party notices, NeXTSTEP and Pixel Spaces.

To make sharing reproducible, the ecosystem uses public GitHub repositories tagged with herdr-layout or herdr-mod alongside a RECIPE.md file. Each recipe specifies what the user sees, how every agent status behaves, which blocks and commands are used, and what edge cases to watch out for. When you ask an agent to install a community layout or mod, AGENTS.md instructs it to read every file first and warn you before writing anything if a mod uses network access (fetch), runs external programs (exec, hc), or reads files outside its own folder—since mods run as trusted local code rather than inside an isolated sandbox.

Concrete requests to get started without designing everything

The official guide suggests asking your agent to read ~/.config/herdr-app/AGENTS.md, then describing the desired result. These examples adapt its prompts; they are not changes we executed for this article:

  • Board: “Create a new layout with agents in columns: needs attention, working and done. Preserve my current layout.”
  • Timer: “Clone the tab bar and add how long each agent has been working.”
  • Homelab: “Add my server as a machine and open a space there with Claude.” This requires SSH access to the host; it does not move the repository onto the laptop.
  • Isolated work: “Open a worktree for issue 42 and start Codex there with the issue as its task.” The agent should check permissions and scope before acting.
  • Review: “Start a reviewer on this branch and summarize its findings.” Herdr organizes the helper; that does not automatically make its answers correct.

Sources and technical references

Thanks for reading. The learning continues in the next article.