dzhng

Claude Agent Server — Development skill for Claude Code

Development

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

How to install Claude Agent Server

This entry records only its repository, not the path inside it, so there is no exact command to give. Open dzhng/claude-agent-server and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Agent Server does

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

Alternatives in Development

  • Happy Coder — by GrocerPublishAgent - Spawn and control multiple Claude Codes in parallel from your phone or desktop 15.7k ★
  • GenericAgent — Self-evolving agent: grows skill tree from 3.3K-line seed, achieving full system control with 6x less token co 6.1k ★
  • Vibekit — A simple SDK for safely running Codex, Gemini CLI, and Claude Code in a secure sandbox 1.7k ★

README

![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

Create a `.env` file in the root directory:

cp .env.example .env

Add your API keys:

ANTHROPIC_API_KEY=sk-ant-your-api-key-here
E2B_API_KEY=e2b_your-api-key-here

Install dependencies:

bun install

2. Build Your E2B Image

Build and deploy the server as an E2B template:

bun run build:e2b

This creates a sandbox template named `claude-agent-server` on E2B. The build process:

  • Creates a sandbox based on Bun 1.3
  • Installs git and clones this repository
  • Installs dependencies
  • Configures the server to start automatically on port 3000

The build may take a few minutes. Once complete, your template is ready to use.

3. Use the Client Library

Install the client library in your project:

npm install @dzhng/claude-agent
# or
bun add @dzhng/claude-agent

Connect to your E2B sandbox:

import { ClaudeAgentClient } from '@dzhng/claude-agent'

const client = new ClaudeAgentClient({
  e2bApiKey: process.env.E2B_API_KEY,
  anthropicApiKey: