The Tamagotchi for AI Agents: Inside paulrobello/claude-office
How a pixel-art simulation reverse-engineers undocumented terminal logs to make invisible LLM workflows physical.
- Claude Office transforms abstract CLI agent operations into a 2D pixel-art simulation.
- The system bypasses the lack of an official API by polling undocumented JSONL files in real time.
- A custom state machine resolves asynchronous subagent spawns using a FIFO arrival queue.
- Strict type synchronization between Python Pydantic models and TypeScript interfaces prevents frontend breakages.
Physicalizing Technical Debt
We are transitioning from simple chatbots to complex agentic workflows. Yet, our tools are still stuck in the terminal. When an AI spawned five subagents to refactor a codebase, it was completely invisible to the user until the terminal spit out a result. Claude Office acts as a visual twin for the CLI. It translates abstract concepts into physical metaphors.
A context window is no longer a number. It is a trashcan filling with paper. Token usage is a stock ticker on a whiteboard. Subagents are employees arriving in an elevator. It is a Tamagotchi for the post-CLI developer, built entirely on a clever hack of undocumented log files.
Tailing the Ghost in the Machine
Anthropic never built a visualizer API for their agent CLI. The entire project is a sophisticated log-tailing exercise. The core Python backend uses a TranscriptPoller to continuously watch undocumented JSONL files in local session directories.
async def poll_logs(self, agent):
with open(agent.filepath, 'r') as f:
f.seek(agent.file_position)
for line in f:
self.process_event(json.loads(line))
agent.file_position = f.tell()
It performs incremental reads to extract tool use and thought blocks without parsing the whole file every tick. This prevents the application from choking on massive context logs.
The Late-Linking Problem
Because subagents spawn asynchronously and logs arrive out of order, mapping text to a synchronous 2D game state is difficult. The backend state machine has to resolve orphan agents that appear in the logs before their parent process acknowledges them.
The developer solved this with a fallback linking system. It matches undefined agents to native IDs using a FIFO arrival queue. It is classic distributed systems logic applied to a pixel-art game.
Type Safety Across the Void
Relying on undocumented JSON structures is notoriously brittle. A single silent update to the CLI format could break the entire visualization. The project mitigates this with a robust make gen-types pipeline.
This pipeline automatically synchronizes the Python Pydantic models with the Next.js TypeScript interfaces. If the log format changes, the type system catches the drift before the frontend attempts to render a corrupted state.
The End of the Solitary Terminal
Claude Office represents a shift in how we interact with autonomous systems. Tools like Atelier and Claudeck attempt to bring agentic capabilities to the browser or native desktop, but they still rely on traditional text interfaces.
As AI performs more autonomous work, developers require ambient awareness. Glancing at a 2D game state out of the corner of your eye is vastly superior to staring at scrolling terminal text. The terminal is for active coding. The office is for supervision.