packages/coding-agent/src/modes/daemon/) separates the agent runtime from its clients. Start it once, then attach as many CLI, TUI, or web clients as you need — they share sessions.
When to use it
- You want to keep sessions warm between terminal launches.
- Multiple clients need to attach to the same session (e.g. web + TUI).
- You want the IPython kernel to stay alive across resumes without re-provisioning.
Start and stop
Attach a client
AgentSessionEvent and sees the same stream.
Protocol versioning
Two version numbers govern wire compatibility:DAEMON_PROTOCOL_VERSION— bumps only for incompatible changes.DAEMON_SCHEMA_REVISION— bumps for schema changes.
Environment forwarding
DAEMON_CLIENT_ENV_KEYS controls which env vars a client can forward to the daemon (so a client-side OPENAI_API_KEY reaches the running agent). Everything else stays on the client. See Configuration.
Related
- Daemon protocol reference — versioning rules and classification.
- Monitoring —
doctor --fixandstatuscommands.