Developer tools
Hive: Persistent terminal workspaces for AI coding agents
A Rust terminal multiplexer that keeps coding agents running independently of the UI, makes their status visible, and isolates parallel work with Git worktrees.

Overview
Hive brings Claude Code, Codex, Gemini CLI, OpenCode, and ordinary shells into one terminal workspace. Repository spaces, tabs, and splits keep work organized, while a shared agent list shows which sessions are working, waiting for input, or done.
The product is an open-source Rust application with binaries for Linux, macOS, and Windows. Agents run unmodified in real terminals, keeping their own models, credentials, and interaction patterns.
The problem
Running several coding agents creates a coordination problem. Developers need to see which agent needs attention, keep parallel edits from colliding, and return to running work after closing a terminal or losing a connection.
Hive addresses that surrounding workflow: terminal ownership, process lifetime, repository context, and clear handoffs back to the developer.
Architecture
Hive separates the interactive hive client from the background hived daemon. The daemon owns pseudo-terminals and running processes; the Ratatui interface presents their state. A shared protocol connects clients and daemon, while separate Rust crates handle workspace management, agent status, notes, and core session behavior.
Tokio supports the asynchronous daemon, portable-pty provides terminal process integration, and vt100 tracks terminal state. Reattaching clients receive a screen snapshot so they can reconstruct the current terminal before continuing with live output.
Engineering decisions
Give processes a lifetime independent of the interface
Closing or detaching the UI leaves agents running in the daemon. Reattaching restores the terminal screen rather than starting another agent. This boundary lets a UI interruption remain a UI problem instead of terminating ongoing work.
Session persistence has explicit limits: live processes survive terminal closure and connection loss, but not a reboot or daemon restart. Ended sessions can be restored, with supported agents resuming their own conversations.
Make parallel work explicit
Hive can open a terminal in a fresh Git worktree and branch, giving another agent a separate working directory. It also warns when agents share a directory. Cleanup protects worktrees with uncommitted changes and does not delete branches.
Show status without taking over the agent
Hive detects agent activity from terminal screen rules or accepts explicit status reports through hive report-agent. The interface surfaces working, needs-input, and done states without answering an agent's prompts. On Windows, status comes from explicit reports.
Keep input ownership clear
Several windows can attach to a session, but only one controls input at a time. Taking control is explicit, allowing observation without competing keystrokes being sent to the same process.
Technical challenge and solution
Reattachment requires more than keeping a process alive. The new client needs a coherent terminal screen and size before it can interpret subsequent output. Hive's protocol includes terminal snapshots and resize updates, keeping session ownership in the daemon while the UI can disconnect and reconnect.
Parallel agents create a separate filesystem challenge. Repository spaces organize context, while optional worktrees separate edits. Combining those boundaries gives the developer a way to supervise multiple agents without assuming that separate terminal panes imply isolated files.
What I built
I built Hive's terminal workspace, background session architecture, agent status workflows, worktree integration, and supporting product experience. Optional integrations bring repository notes, Git review, GitHub checks, and project tasks beside the running agents.
Engineering takeaways
- Process lifetime and interface lifetime need separate owners when work must survive disconnects.
- Terminal state reconstruction is part of recovery, alongside session metadata.
- Parallel coding needs filesystem isolation as well as a way to see agent status.
- Clear input ownership makes shared observation predictable.
Stack
- Rust
- Tokio
- Ratatui
- PTY
- Git worktrees
- CLI