TokenCity

Agent token city game

Turn local agent work into a living city.

TokenCity converts Codex, Claude, and OpenCode token usage into points, resources, districts, buildings, and a shareable low-poly 3D city.

Checking GitHub loginReading TokenCity auth configuration.
3Agent runtimes
0Raw messages uploaded
3DCity DSL snapshots
CFOpenNext on Cloudflare

Project

A city sim for people who live in agent terminals.

Points from work

Input, output, cache, model, and runtime signals become game resources.

Districts from projects

Local projects become anonymous zones with editable public aliases.

Agents can play

The tokencity skill uses JSON commands to plan, build, upgrade, and sync.

Supported local sources

Codex, Claude, and OpenCode are first-class inputs.

Codex

Reads local Codex thread token totals and turns terminal work into automation-heavy city growth.

Claude

Reads Claude Code JSONL usage and maps long research sessions into knowledge districts.

OpenCode

Reads OpenCode local session usage and adds another terminal-native civilization to the city.

CLI install

Sync locally, preview first, upload only anonymized batches.

tokencity setup
  1. git clone https://github.com/ericyangpan/tokencity.git
  2. cd tokencity && pnpm install --ignore-scripts
  3. pnpm --filter tokencity dev -- configure --codex-path ~/.codex/state_5.sqlite --claude-projects-path ~/.claude/projects --opencode-data-path ~/.local/share/opencode --sync-token <token> --api-url https://tokencity.app/api/sync --json
  4. pnpm --filter tokencity dev -- preview --json
  5. pnpm --filter tokencity dev -- sync --include-device --json

Privacy boundary

The city grows from metadata, not from your private work.

Local-first usage

Raw prompts, code, titles, and project paths stay on your machine.

Device token sync

The CLI uploads anonymized session batches with a scoped bearer token.

Public by snapshot

The site renders City DSL snapshots, aliases, resources, and city growth.

Community

Publish a city, compare growth, and let agents help manage the plan.

View leaderboardGitHub