ClawTerm is a session-persistent binary protocol for AI agent terminals. Inspired by X.25 packet switching and IBM SNA. Built in C. Runs as a Kubernetes DaemonSet. Your AI sessions survive network drops, device switches, and reboots — because the session never closes.
Features
Every design decision exists because HTTP/WebSocket is the wrong foundation for persistent AI agent sessions.
Protocol Spec
Everything on the wire. 15 bytes of overhead. Big-endian. CRC-16/IBM checksum.
| Type | Value | Direction | Description |
|---|---|---|---|
| CT_CONNECT | 0x01 | C→S | Establish new session |
| CT_ACCEPT | 0x02 | S→C | Session accepted, return session_id |
| CT_RESUME | 0x03 | C→S | Reconnect to existing session |
| CT_RESUMED | 0x04 | S→C | Resume ack + replay buffered frames |
| CT_DATA | 0x10 | Both | Agent I/O payload |
| CT_KEEPALIVE | 0x20 | Both | Session heartbeat (30s interval) |
| CT_SUSPEND | 0x30 | C→S | Client going away — session stays warm |
| CT_DISCONNECT | 0x40 | Both | Clean session teardown |
Why ClawTerm
HTTP is a stateless document delivery protocol. AI agents need persistent sessions. ClawTerm is built for the problem, not bolted onto a workaround.
| Capability | WebSocket | ClawTerm |
|---|---|---|
| Session persistence | App-layer only | Protocol-native |
| Mobile disconnect | Session dies | SUSPEND / RESUME |
| Multi-device resume | New session | Any device, full context |
| Frame overhead | HTTP headers + framing | 15 bytes |
| Concurrency model | Thread / goroutine per conn | epoll, 10K+ / core |
| Pod IPC | Network required | Unix socket, zero-hop |
| Mobile transport | TCP only | QUIC (connection migration) |
| GC pauses | Runtime-dependent | Zero (C) |
In Production
Teams running AI agents at scale on why they chose ClawTerm over HTTP and WebSocket.
We migrated our entire agent fleet from WebSocket polling to ClawTerm in a single sprint. Session recovery dropped from 8 seconds to zero. Production incidents tied to agent context loss: eliminated. The protocol does exactly what it says on the tin.
— Maya Chen, AI Platform Lead · Nexus Systems
We were rebuilding session state on every mobile reconnect — a full round-trip to the LLM each time. ClawTerm's SUSPEND/RESUME cut that to a single frame replay. Our agents just keep working. Customers don't even notice the network switch.
— Dmitri Volkov, CTO · AgentScale.io
HTTP was never designed for this. ClawTerm is. 15-byte frames, epoll, Unix sockets — it reads like a protocol written by someone who actually studied how X.25 solved these problems forty years ago. Finally a transport layer that respects the constraints of real agent infrastructure.
— Sarah Okafor, Core Contributor · agent-runtime
Channel Support
ClawTerm sessions are transport-agnostic. The same persistent session ID is addressable from TCP, Telegram, WhatsApp, or any OpenClaw-powered channel — resume mid-conversation from a different app.
Quick Start
ClawTerm is the transport layer powering ClawForge — the customer session layer for AI agents. Deploy AI employees that know your business, with sessions that never drop.
Pricing
ClawTerm is MIT licensed. Run it on your own infra for nothing — or use Lobster Hosting and skip the ops.
SELF-HOSTED
MIT license. Your infra. Your K8s.
LOBSTER HOSTING
Managed. Dynamic DNS. No static IP.
LOBSTER + STATIC IP
Production-grade. Fixed IP. Your domain.
Enterprise / high-volume? hello@deeptxai.com