Brian Hung
Projects
Composer
A web app that runs Claude Code in a Cloudflare Sandbox and talks to it over the Agent Client Protocol.
Starting a task
Cloudflare Worker
calls sandbox.exec
POST /api/start
not yet
already running
sandboxId
ChatEditor
handleSubmit, new taskId
updateSandboxId
the task gets its sandbox
ACPTaskProvider
initialize, newSession
getSandbox
a container per sandboxId
isWebsocketdRunning
curl localhost:8080
setupWebsocketd
npx claude-code-acp on 8080
Setup polls every 200 ms, for up to 3 s, until the agent's socket answers.
Sending a prompt
Browser
the task page
Sandbox
a container
sendPrompt
stdin
stdout
sessionUpdate
ChatEditor
react-prosemirror
ClientSideConnection
@agentclientprotocol/sdk
ZustandACPClient
writes into useACPStore
Worker
wsConnect to port 8080
websocketd
WebSocket to stdio
claude-code-acp
Claude Code over ACP
Replies ride the same socket: message chunks, tool calls, plan updates and permission requests.