Vivarium

June 19, 2026 ยท View on GitHub

An AI agent that lives inside a microsandbox microVM alongside your app. It has full access to the filesystem, the running process, and a browser โ€” write code, run it, screenshot it, and auto-save to git. You talk to it from your phone; it builds while you do anything else.

How it works

You (phone):  "Build me a tip calculator"
Vivarium:     Done! Here's a screenshot:
              ๐Ÿ“ธ [screenshot of running app]
              Live at :3000, pushed to git.

You:          "Make the split stepper bigger"
Vivarium:     Updated โ€” bumped hit targets to 48px.
              ๐Ÿ“ธ [screenshot]

The agent lives with your app โ€” same VM, same filesystem, same network. It doesn't remote in; it's already there.

Architecture

You (chat) โ”€โ”€โ†’ vivarium-hub (message broker) โ”€โ”€โ†’ WebSocket โ”€โ”€โ†’ Vivarium (this repo)
                                                                    โ”‚
                                                                    โ”œโ”€โ”€ Claude Agent SDK
                                                                    โ”œโ”€โ”€ /workspace (git repo + your app)
                                                                    โ”œโ”€โ”€ Chromium (screenshots)
                                                                    โ””โ”€โ”€ App running on :3000

The vivarium connects outbound to the hub via WebSocket โ€” no port opening or firewall config needed. Your API key is never sent to the hub โ€” it stays in your microVM and goes directly to Anthropic.

Quick start

Prerequisites

One-command install

curl -fsSL https://vivarium.run/install | bash -s -- --token <TOKEN>

This installs the @vivarium/cli (viv command), which uses microsandbox to run the agent in a lightweight microVM.

Environment variables

VariableRequiredDescription
ANTHROPIC_API_KEYโœ…Your Anthropic API key
HUB_URLโœ…WebSocket URL of your hub (e.g. wss://hub.example.com/ws)
HUB_TOKENโœ…JWT token from the hub
VIVARIUM_NAMEName for this vivarium (default: my-vivarium)
MAX_TURNSMax agent turns per message (default: 30)
MODELClaude model (default: claude-sonnet-4-5)

What's inside

  • Agent runner (src/agent/runner.ts) โ€” drives Claude via the Agent SDK, manages conversation turns
  • Tools (src/agent/tools.ts) โ€” screenshot, app-restart, and other capabilities
  • WebSocket client (src/ws/client.ts) โ€” connects to the hub, handles reconnection
  • Skills (skills/) โ€” persistent instructions that teach the agent how to serve apps, take screenshots, manage git, etc.
  • Auto-save โ€” commits to git every 15 minutes so nothing is lost

Development

npm install
npm run build
npm test
npm run dev   # needs ANTHROPIC_API_KEY, HUB_URL, HUB_TOKEN

License

MIT