an autonomous-agent sandbox

The rules aren't coded.
They're decided by agents.

Claudeburg is an isometric town where every building and every avatar is a live Claude agent. No hardcoded prices, no scripted quests — a cafe decides what to sell and whether to hire, an avatar decides what to ask and whether to take the job. They negotiate through a shared toolset, in real time.

Claude · Anthropic streaming SSE agent-to-agent tools persistent memory
localhost:5173 — claudeburg
Claudeburg — isometric town with live agent chat: an avatar reports it earned $30 and plans its next move
A live turn: the avatar agent finishes a shift, banks $30, and decides on its own to go shopping — narrated in the chat, played out on the map.

01 Two agents, one loop

The player types into a chat box. From there, it's agents all the way down — the avatar runs a tool loop, and when it use()s a building, the server recurses straight into that building's own agent thread.

player chat box
POST /api/agent-chat
avatar agent world · status · move · use · create · transfer · engage · leave
use(building) — nested sub-loop
building agent same toolset · own thread · own inventory · own memory

The target agent's text blocks become the caller's tool_result. Nesting is capped at MAX_USE_DEPTH = 3 so avatar → cafe → bank → broker bails out instead of running away.

02 Born from a prompt

Nothing in the town is pre-drawn. Type a description and the server runs an OpenAI image pipeline, streaming progress back over SSE as the sprite takes shape.

buildingsone gpt-image-1.5 pass → auto-trimmed sprite
avatars4-pass: front ref → 4 iso directions → step frames
personalitya free-text Character field feeds the avatar's agent prompt
generate-avatar — live SSE
Generate-avatar modal: a prompt box, a live SSE log reviewing pose accuracy and rendering each isometric view, the finished character, and a Character personality field
Live pose-by-pose generation, narrated as it runs — front reference, each isometric direction, then step frames, ending in a playable agent.

03 Build the town live

A full isometric editor runs right in the browser — paint terrain, drop buildings and avatars, scatter vegetation. Every action is persisted to MongoDB and undoable.

4 tabsTerrain · Objects · Buildings · Avatars
toolsSelect / Move · Clear · Scatter, snapped to the iso grid
undo / redoCommand-pattern history, ⌘Z, 100 steps deep
editor — Objects tab
In-browser isometric editor: the town with a tabbed HUD (Terrain, Objects, Buildings, Avatars), a vegetation palette, and Select/Move, Clear and Scatter tools
Tabbed palette, grid-snapped placement, and keyboard-driven undo — the same world the agents then come alive in.

04 The shared toolset

Every agent — avatar or building — is handed the same tools. Role mismatch is resolved by the prompt, not by branching code. This is the entire vocabulary of the world.

worldList nearby buildings & avatars with distances.
statusSelf position, hunger, energy, balance, inventory.
moveA* pathfind to a target; client animates the walk.
useTalk to a building/avatar (sub-loop) or consume an owned item.
createMint an Item with free-form props — price, hunger, energy.
transferHand an item over; price is auto-deducted from balance.
engageBind an avatar to an activity with per-second stat effects.
leaveEnd the activity — settles the partial second cleanly.
suggestOffer the player 2–4 clickable reply buttons.
memoryRemember / forget facts, injected into the prompt each turn.

05 What makes it feel alive

⟿

Streamed thinking

Anthropic responses stream as text_delta SSE events — the player watches the agent type, and the building's reply lands in the same live row.

↻

Real-time economy

A per-second ticker commits ±balance / hunger / energy effects, auto-evicts on a negative balance, and auto-ends on a deadline. Math runs server-side, drift-free.

⌥

Emergent rules

Rates, conditions, who-can-be-hired — none of it is in code. It lives in the prompts. Two cafes on the map have distinct threads, inventories and memories.

⊟

Persistent memory

Each agent keeps its own Memory collection — embedded on write, recalled by semantic similarity, and re-injected into its system prompt on every future turn.

06 Retrieval-augmented agents

An agent's memory isn't a flat log it re-reads in full. Every fact it chooses to keep is embedded into a vector and stored alongside the rest. On each turn the current situation becomes a query — and only the most relevant memories are pulled back into context.

1embedfacts → vectors on write
→
2retrievetop-k by cosine similarity
→
3augmentinject into the prompt
→
4generateClaude answers in context

The result: a cafe remembers a regular's usual order, an avatar remembers who shortchanged it — without ever blowing the context window on history that doesn't matter this turn.

07 A turn, verbatim

player ▸ поработай в кафе секунд 30
avatar  ▸ move(cafe) … use(cafe, "есть работа на 30 секунд?")
  cafe  ▸ нужен официант, $1/сек. согласен?
avatar  ▸ use(cafe, "да")
  cafe  ▸ engage(avatar, "work", [{balance:+1}], max_duration_sec:30)
system  ▸ 💼 +1$/s · sprite hidden · portrait at cafe
system  ▸ 💰 ticking +1 each second …
system  ▸ +30s → avatar_leave (timeout) · earned $30

08 Under the hood

Claude / Anthropic SDK Phaser 3 + TypeScript Express MongoDB vector embeddings · RAG Server-Sent Events A* pathfinding Vite