# ADR 0005: Use PTY-Backed Runtime For CLI Agents

## Status

Accepted.

## Decision

Run command-driven agents through PTY-backed sessions managed by the runtime.

## Context

Claude Code, Codex, Droid, Kiro, Gemini, OpenCode, and shell sessions interact through terminal-oriented processes. The browser can attach, detach, and reconnect while the runtime preserves PTY state.

## Consequences

- Terminal session manager owns process lifecycle.
- Terminal state mirrors preserve reconnectable views.
- Protocol filtering protects TUI startup behavior.
- Hook adapters translate agent-specific activity into shared task summaries.
