Architecture
Overview
How Krad ADE is built, from the GPUI views down to terminals, chats, hosts and the agents bus.
Krad ADE is written in Rust on GPUI, with real terminal emulation from libghostty-vt, ConPTY on Windows, WSL support and no Electron. The source is a Cargo workspace of single-responsibility crates, licensed MIT or Apache-2.0.
The shape of the app
krad-ui (GPUI views)
├── krad-session (PTY + terminal glue)
│ ├── krad-pty (Unix PTY, ConPTY, WSL)
│ └── krad-term (libghostty-vt)
├── krad-agents (loopback bus) ◄── krad-ade-agents CLI, line JSON
├── krad-chat (harness chats, Gateway agent) ──► krad-host
├── krad-repo (files, git, notes) ──► krad-host
├── krad-lsp, krad-extensions (language servers) ──► krad-host
├── krad-store (layout, settings, keyring)
├── krad-update (signed releases)
└── krad-gitlab, krad-github (code hosts)
krad-host: this computer or an SSH hostFour pipelines
- Chats. A chat drives its harness without a terminal and renders its stream natively. Claude Code's stream-json, opencode's server events, Codex's app-server notifications and the Gateway agent's own loop become the same chat events. See Chat pipeline.
- Terminals. A terminal is a PTY paired with an emulator. A dedicated thread pumps its output through a bounded channel, the emulator turns bytes into snapshots and the UI paints only what is on screen. See Terminal pipeline.
- Hosts. Files, commands and language servers go through a host link, so the same code works on this computer and over SSH. See Hosts.
- Agents. Agents report their state through their vendor's hooks and reach each other, and the lead, through a token-protected loopback endpoint. See Agents bus.
Decisions that shape it
A few design choices run through every part of the app:
| Decision | Consequence |
|---|---|
| No session daemon | Closing the app ends every process. Layout, scrollback and resume ids are saved, and on reopen shells are relaunched and agents resume their harness's conversation. |
| Agents as harness CLIs | The app drives the agent programs you already installed and signed in to, instead of calling model APIs, except for the Gateway's own engine. |
| System CLIs over libraries | git, ssh, tar and wsl.exe run through their CLIs, so your config, credentials and hooks apply. |
| Languages as data | Languages, toolchains and language servers come from manifests and Mason's registry, not code. |
| One theme for everything | A theme colours the interface, the terminals and the editor at once. |
| Synchronous I/O crates | Host, store, repo, code host and chat crates are synchronous, with no async runtime; the UI calls them from the background executor. |
Platforms
One codebase builds a native app per platform: macOS, Windows and Linux on Wayland or X11. On Windows, local shells and WSL shells run over ConPTY, and the installer ships its own ConPTY so escape sequences such as the kitty graphics protocol pass through unchanged.
Continue with Crates.