A demo chat application using the Claude Agent SDK with a React frontend and Express backend.
- Node.js 18+
- Claude Agent SDK credentials (set
ANTHROPIC_API_KEYenvironment variable)
npm installnpm run devThis starts both:
- Backend (Express + WebSocket) on http://localhost:3001
- Frontend (Vite + React) on http://localhost:5173
Open http://localhost:5173 in your browser.
This is an example app for demonstration purposes. For production use, consider:
-
Isolate the Agent SDK - Move the SDK into a separate container/service. This provides better security isolation since the agent has access to tools like Bash, file system operations, and web requests.
-
Persistent storage - Replace the in-memory
ChatStorewith a database. Currently all chats are lost on server restart. -
Transcript syncing - For Agent Sessions to be persisted across server restarts, you'll need to persist and restore the SDK's conversation transcripts. The SDK maintains internal state for multi-turn conversations that must be synced with your storage.
-
Authentication - Add user authentication and authorization. Currently anyone can access any chat.

