Build an AI coding agent that runs on an IBM PC XT under DOS

Ricapar had Claude write ClawDOS, a 176 KB DOS coding agent that runs on a 4.77 MHz 8088, then used it on the XT to write a WarGames demo in Turbo C.

Done withClaudeinAnthropic· Nov 21, 2026

What they did

Ricapar, who collects vintage PCs, wanted an AI coding agent running on original IBM PC XT hardware: an 8088 at 4.77 MHz, 640K of RAM and a CGA card. They had Claude write the entire project, about 13,000 lines of C and C++ built for the 8086 with Open Watcom, apart from one note on the project page. The result is a DOS program that talks to the Claude Messages API itself, streams replies to an 80 column chat screen and gives the model eighteen tools: read, search and edit files, run DOS programs and compilers, peek and poke memory and ports, take CGA screenshots encoded as PNG on the 8088, play the PC speaker and keep notes between sessions. A second machine only handles TLS. It was tested in DOSBox-X against a mock API, in the 86Box emulator and on a real 5160.

How it went

It works on the real machine. Asked to write and run a prime number program, it had the answer on screen 64 seconds after Enter, 26 of them spent compiling and running. On the XT it then wrote a tribute to the film WarGames: five Turbo C files, 15 KB of source and an executable under 10 KB with a vector world map and PC speaker music. It can reopen that work in a later chat from its saved notes. The HN post reached 106 points.

Worth knowing

The poster says Claude wrote the code but does not name the harness used to build it. Prompt caching is what makes the slow link usable: after the first request a tool result goes up in about 500 bytes. Edits ask for approval by default.

Try it

With Claude· 7 parts to fill in

Build an AI coding agent that runs natively on [old or constrained machine and OS]. It should call [model API] directly, stream replies to the screen, and give the model tools to list, read, search and edit files, run programs and compilers, and keep notes between sessions. Offload only what the machine truly cannot do, such as [TLS], to a helper on [another machine]. Keep the binary under [size] and the memory footprint within [limit]. Write tests against a mock API and run them in [emulator] before real hardware. Ask before each change to the build setup, and stop when a one-line request can write, compile and run a small program on the target.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related