Skip to content
All posts

5 November 2026

Claude built a solar system

I asked Claude to build a physically rigorous solar system simulator, in a domain I know nothing about. 32 bodies from real ephemerides, two clients, one engine. The interesting part isn't what it built, it's what I had to build to be able to trust it.

The simulator showing the inner solar system: the Sun with Mercury, Venus, Earth and Mars on their orbital paths against a star field, with off screen pointers marking where Uranus, Jupiter and Saturn lie

I gave Claude a domain I don’t know and asked it to build something real in it.

The result is a solar system simulator. 32 bodies positioned from real ephemerides, their own rotational elements, axial tilts and ring systems. You can switch between following the published orbital tables and running a full N body gravity simulation. You can stand on the surface of the five worlds that have ever been photographed from their own surface. You can ask what it would actually take to make Mars habitable and get an answer derived from energy balance and atmospheric escape rather than asserted.

52 commits over ten days. Two clients, one physics engine: a Next.js site and a native iPhone app in SwiftUI and SceneKit.

The problem with not knowing the domain

Normally I review what the model writes. That’s the whole basis of my argument that AI assisted engineering is fine as long as a competent engineer stays in the loop. I’ve built video players for 15 years, so when Claude writes playback code I can tell immediately when it’s wrong.

Orbital mechanics is not that. I cannot look at a perturbation term and know it’s correct. I had no intuition to catch anything with.

So instead of reviewing it, I made it provable.

Contracts, not vibes

Twelve written contracts define what every client has to agree about. Units and reference frames, time scales, how satellites are oriented, what the gravity modes mean, and the master one covering gravitation, orbits, perturbation, relativity, conservation and integration, each claim tied to its source.

One of them is just: no client and no model states a figure the engine did not compute. Nothing on screen is typed in. If a number appears, something calculated it and something tested it.

Then a conformance suite of 538 cases across 17 domains runs against both the TypeScript engine and the hand ported Swift one, so the two implementations cannot quietly drift apart. It caught two real defects the first time it ran.

The Earth information panel from the simulator, showing distance from the Sun, equatorial radius, rotation period, axial tilt, atmosphere composition, and a footer citing the JPL Standish tables and the IAU WGCCRE report
Every figure here is computed, and the panel says where it came from and how good it is.

Three failures that taught me something

The web client once shipped with the entire solar system rolled ninety degrees and every single test green. Every number was right. The one view anybody had checked was the single orientation where up doesn’t matter. So now the probes read geometry rather than pixels, because a screenshot cannot tell a moon drawn in the wrong place from one too small to see, and both look like nothing at all.

The citation checker re-resolves every cited DOI and confirms it says what we claim it says. The first time it ran, it found a citation attributing Juno’s magnetic field model to a 1992 volume of Nature. The model is real, the paper exists, the reference was invented. That is exactly the failure mode everyone warns about, and the only reason it didn’t ship is that something mechanical went and checked.

And the interaction tests launch the iPhone app and tap things, because a control can render perfectly, pass every arithmetic gate, and ignore every touch.

Saying what it isn’t

Heliocentric positions are good to roughly 20 arcseconds between 1800 and 2050, which is the published error of the tables themselves, about 14,000 km at one astronomical unit. Enough to answer hit, escape or stay. Not enough to claim a flyby distance to the kilometre. The Moon comes from mean elements and is good to about a degree.

The interface says so, in the places where it matters. Where two sources disagree, the body contract says so out loud instead of burying it in a tolerance.

What I actually take from this

The thing that made this work wasn’t better prompting. It was deciding up front what would count as evidence, and then building the machinery to produce it. 945 TypeScript tests, 43 Swift tests, 538 conformance cases, plus gates that re-check the citations and the imagery against the live internet.

That’s a lot of scaffolding for a side project about planets. But it’s the only reason I’m willing to put my name on code in a field I don’t know. The model can write the orbital mechanics. It cannot tell me whether to believe it. That part still has to be engineered.

It’s MIT licensed, and it’s live here.