dzhng/claude-agent-server

574 stars · Last commit 2025-12-28

Run Claude Agent (Claude Code) in a sandbox, control it via websocket

README preview

![download-kg285ggv19c87syh8aebykaxk97vs261 (1)](https://github.com/user-attachments/assets/9934e58d-7f8e-4f79-8427-5f2e65aeaeb0)

# Claude Agent SDK WebSocket Server

A WebSocket server that wraps the Claude Agent SDK, allowing real-time bidirectional communication with Claude through WebSockets. Deploy it as an E2B sandbox and connect via the TypeScript client library.

[Launch tweet / discussion](https://x.com/dzhng/status/1991154972558581889?s=20)

## Overview

**Typical Workflow:**

1. **Build Your E2B Image** - Deploy the server as an E2B sandbox template using `bun run build:e2b`
2. **Use the Client Library** - Install `@dzhng/claude-agent` in your project and connect to your E2B sandbox
3. **Modify the Server (Optional)** - If you need custom behavior, edit the server code in `packages/server/`
4. **Test Locally** - Use `bun run start:server` and `bun run test:local` to test your changes before rebuilding

## Quick Start

### 1. Setup Environment

View full repository on GitHub →