<!-- Canonical page: https://reversedwithai.com/p/klonoa-gba-decomp -->
Canonical page: https://reversedwithai.com/p/klonoa-gba-decomp

# Started a decompilation from zero: Claude Code and 51% of a 2001 GBA game

> A GBA decompilation started from zero, now past halfway.

With custom tooling around it, Claude Code did most of the decompiling of Klonoa: Empire of Dreams, reaching 51% of code bytes.

## Key facts

- Target: Klonoa: Empire of Dreams (GBA)
- Category: Games and mods
- Platform: Game Boy Advance
- Models: Claude
- Tools: Claude Code, Ghidra, objdiff, Luvdis, asmlift, Transmuter, gba-kit
- Outcome: Partial
- Checks: Source available: yes; Repro steps: yes; Real hardware: not reported; Verified by others: not reported
- Author: Macabeus
- Added: 2026-10-13
- Updated: 2026-10-13
- Sources reviewed: 2026-10-13 (editor)

## What was done

Macabeus started a matching decompilation of Klonoa: Empire of Dreams, a Game Boy Advance game from July 2001, and had Claude Code do most of the work, with custom tooling around the agent. The write-up, dated 17 August 2026, says the project reached 51% of the game's code bytes decompiled (51 percent) and 663 identified functions; the README links a decomp.dev progress page for the live figure. The AI commit census counts 194 of 313 commits with AI credit (mostly Claude Opus 4.6, 4.8 and 4.7), from 15 March to 5 October 2026.

## Scaffolding and the loop

Claude Code wrote the scaffolding: a `generate_asm.py` script, the Makefile and the linker script. No ROM-derived assets go into Git, and function splits, names and data regions live in TOML files that the generator reads. The Luvdis disassembler found 93 functions, Ghidra added about 300, and further AI-assisted searching brought the total to 663 after false positives were removed. The compiler is agbcc, a GCC 2.95 fork.

The decompilation loop, whose prompt is linked from the asmlift repository, works like this: Claude Code picks a batch of functions, asmlift (the author's programmatic decompiler) attempts them, Transmuter helps when a match fails, the gba-kit emulator is used to improve names, adversarial subagents review the code, and the batch is merged as one PR with a report. objdiff measures how closely the C matches the original assembly. Cleaner functions from testyourmine's earlier kleod work were imported to set a quality bar.

## What came out

Along the way Claude Code found a hidden minigame on the "Clear Save Data" screen that had gone unnoticed for 25 years. Open problems include fragmented functions from a splitting bug, jump tables mistaken for code, and AI-written C that is messier and more verbose than hand-written matches. The author names cognitive debt as the main risk and plans a cleanup phase next.

To build, you need your own copy of the USA ROM as baserom.gba, the ARM GNU toolchain, GNU Make, Python 3.13 or newer and a host C compiler, which setup.sh uses to build the agbcc fork. A successful build prints klonoa-eod.gba: OK, which confirms a byte-identical match against the original ROM. Mizuchi is optional, for browsing and decompiling functions automatically.

Sources:
- https://github.com/Dream-Atelier/kl-eod-decomp
- https://gambiconf.substack.com/p/starting-a-decompilation-project

## Human work and limitations

When stuck, the agent forked the compiler and used register pins to force matches; the author first accepted one such fork before a later PR showed it was unnecessary, and experienced decompers rejected the cheats. The author built asmlift, Transmuter and gba-kit, wrote the loop prompt and reads every report.

## What the commit history shows

194 of 313 commits in the public repository credit an AI, over 23 days between 2026-03-15 and 2026-10-05. Credited: Claude Opus 4.6 (102), Claude Opus 4.8 (44), Claude Opus 4.7 (39), Claude Opus 5 (8).

Measured by this site from public git history.

## Sources

- [Repository](https://github.com/Dream-Atelier/kl-eod-decomp)
- [Write-up](https://gambiconf.substack.com/p/starting-a-decompilation-project)

Figures are reported by the author and not measured by this site, except the commit history. Entry drafted with AI from the linked sources and checked against them.

Cite as: Macabeus (2026). Started a decompilation from zero: Claude Code and 51% of a 2001 GBA game. Reversed with AI. https://reversedwithai.com/p/klonoa-gba-decomp
