Inspiration
I'm a frontend developer, and I hand most backend and infrastructure work to AI coding agents. They are fast — and they change dozens of files in one go. When the pull request lands, the diff tells me what changed line by line, but not where in my project the change lives or which file I should look at first. Developers already spend most of their time understanding code rather than writing it (Xia et al., IEEE TSE 2018, ~58%), and code-city visualizations have been shown to help people answer structural questions faster (Wettel, Lanza & Robbes, ICSE 2011). Agent-written changes make that problem bigger, not smaller.
What it does
Code City turns one pull request into a small city that stands on the empty part of your desk, next to your laptop — never on top of its screen.
- Folders are districts, files are buildings. Only files the change touched are under construction; the more lines changed, the brighter their scaffolding glows. Untouched files stay small and dim and ignore pinches.
- Pinch a building and a card unfolds above it: file name, lines added/removed (or "binary file"), and the commit message. Read that diff on your laptop, look back, and pinch Confirm on the card — the scaffolding comes down and the "remaining" counter drops. Pinch the building again to fold the card away. At zero it says review complete.
- Dense district? Folder tabs float above the city; pinch a tab (or the district's front edge) to zoom that folder to the whole plate; All brings you back.
- The plate follows your gaze across the desk and drops with one pinch; it stays within ~60 cm and on the laptop's left.
- The demo city is this lens's own repository: the 48 files Snap's CLAD agents changed while building Code City (
2a755fb → 89aea87). You review the agent that built the tool, with the tool.
Why glasses
The laptop screen is already full of the diff and the editor. Putting the same city in a 3D view on the laptop means splitting the screen or switching tabs, and turning the model means leaving the keyboard for the trackpad — and you lose track of what you've reviewed. On glasses the city draws in the world beside the screen, and you change the angle by tilting your head, keeping your hands on the keyboard and pinching only to pick the next file.
How we built it
- Planning: the
plan-lensinterview turned the idea intodevpost/design-brief.md— one spatial moment, placement in centimeters, the interactions, and five done criteria checkable in Lens Studio's preview. - Building with CLAD: Snap's CLAD plugin ran the build as parallel step agents (plan, scripts, UI, sound, icons, scene bootstrap, static and runtime audits) through the Lens Studio MCP — scene edits, recompiles, preview captures and simulated pinches, all from the agent. Three fix cycles were driven by what we saw in the preview.
- Everything is code-built: without AI 3D generation, the desk, laptop, plate, districts, buildings and markers are generated at runtime with MeshBuilder from repository data; sounds are synthesized locally.
- Data: a small Node script (
tools/make-snapshot.mjs) reads a git range and writes a TypeScript snapshot the lens bundles, so the demo never depends on the network. An optional live mode (off by default) fetches the same range from the GitHub REST API with the InternetModule and falls back silently to the snapshot. - Testing with LEAF: every done criterion has a LEAF scenario that drives SIK pinches in the preview and asserts on the lens state; the scenarios derive their expectations from whatever snapshot is active.
| Done criterion | LEAF scenario | Preview |
|---|---|---|
| Plate follows gaze, drops left of the laptop, screen never covered | codecity-c1-place |
pass |
| City matches the data: districts, buildings, markers, brightness by churn | codecity-c2-city |
pass |
| Card unfolds with file, +/- lines, commit; moves to the next building; folds on a second pinch | codecity-c3-card |
pass |
| Confirm inside the card checks the file and decrements the counter | codecity-c4-check |
pass |
| District zoom and back to the whole city | codecity-c5-zoom-busiest, codecity-c5-zoom-nested |
pass |
Challenges
- Dense repositories. With 48 changed files the overview could not keep 3 cm buildings, and an early layout let buildings overlap — hiding files. The layout now shrinks only the overview, never overlaps, and every zoomed level returns to full size.
- Pinch targets inside a city. Buildings covered whole districts, and the plate's drag area stole district pinches. Each district now keeps a bright, building-free grab strip at its front edge, folder tabs float above the tallest building so no district is ever unreachable, and the plate is dragged only by its rim.
- Open, fold, confirm. Trying it in the preview, "pinch the card again to confirm" felt wrong, so the card now unfolds and folds with the building, and reviewing is an explicit Confirm button inside the card.
- Additive display. Dark materials disappear on glasses, so low-change markers moved from dark brown to pale amber and UI panels use dim tinted backings under bright text.
Accomplishments
- One spatial moment, done end to end, with all five done criteria passing as LEAF tests.
- The lens can show its own build history — a self-referential demo that is also a real workflow.
What we learned
Describing the moment precisely (where things sit, when they appear, what a pinch does) mattered more than any line of code: the agents built what the brief said, and the preview + LEAF loop caught what the brief didn't.
What's next
- Try it on real Specs: comfort over time and pinching 2–3 cm targets with real hand tracking are still feel unproven.
- Pick the pull request inside the lens, and hook the snapshot step into agent sessions so every agent PR arrives as a city.
- Highlight files the agent's own tests touched, and order the review by risk.
Built with
Lens Studio 5.25 · SPECS · CLAD (Snap's Lens Studio agent toolkit) · Lens Studio MCP · LEAF · Spectacles Interaction Kit 4.0 · UI Kit 4.0 · TypeScript · Claude Code · Node.js · git
Links
- Code: https://github.com/Jone4865/specs-lens
- Demo video (recorded from the Lens Studio Preview panel, SPECS 27; narration is synthesized): https://youtu.be/LSgC_0DMqDs
Built With
- clad
- claude-code
- git
- leaf
- lens-studio
- lens-studio-mcp
- node.js
- specs
- spectacles-interaction-kit
- typescript