{
  "api_version": "1.0.0",
  "slug": "klonoa-gba-decomp",
  "url": "https://reversedwithai.com/p/klonoa-gba-decomp",
  "markdown_url": "https://reversedwithai.com/p/klonoa-gba-decomp.md",
  "json_url": "https://reversedwithai.com/p/klonoa-gba-decomp.json",
  "title": "Started a decompilation from zero: Claude Code and 51% of a 2001 GBA game",
  "tagline": "A GBA decompilation started from zero, now past halfway.",
  "summary": "With custom tooling around it, Claude Code did most of the decompiling of Klonoa: Empire of Dreams, reaching 51% of code bytes.",
  "target": {
    "name": "Klonoa: Empire of Dreams (GBA)",
    "type": "game",
    "type_label": "Games and mods"
  },
  "platform": "Game Boy Advance",
  "models": [
    "Claude"
  ],
  "tools": [
    "Claude Code",
    "Ghidra",
    "objdiff",
    "Luvdis",
    "asmlift",
    "Transmuter",
    "gba-kit"
  ],
  "outcome": "partial",
  "outcome_label": "Partial",
  "human_effort": null,
  "time_spent": null,
  "cost": null,
  "license": null,
  "checks": {
    "source_available": "yes",
    "repro_steps": "yes",
    "real_hardware": null,
    "independently_verified": null
  },
  "author": {
    "name": "Macabeus",
    "url": null
  },
  "sources": {
    "repository": "https://github.com/Dream-Atelier/kl-eod-decomp",
    "writeup": "https://gambiconf.substack.com/p/starting-a-decompilation-project",
    "discussions": [],
    "all": [
      "https://github.com/Dream-Atelier/kl-eod-decomp",
      "https://gambiconf.substack.com/p/starting-a-decompilation-project"
    ]
  },
  "image": {
    "url": "https://covers.reversedwithai.com/klonoa-gba-decomp.webp",
    "credit": "gambiconf.substack.com"
  },
  "commit_history": {
    "commits": 313,
    "ai_commits": 194,
    "ai_days": 23,
    "first_ai_commit": "2026-03-15",
    "last_ai_commit": "2026-10-05",
    "credited_models": [
      {
        "name": "Claude Opus 4.6",
        "commits": 102
      },
      {
        "name": "Claude Opus 4.8",
        "commits": 44
      },
      {
        "name": "Claude Opus 4.7",
        "commits": 39
      },
      {
        "name": "Claude Opus 5",
        "commits": 8
      }
    ]
  },
  "added_at": "2026-10-13T00:00:20+00:00",
  "updated_at": "2026-10-13T00:00:20+00:00",
  "sources_reviewed_at": "2026-10-13T00:00:20+00:00",
  "reviewed_by": "editor",
  "human_notes": "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.",
  "reproduce": null,
  "body_md": "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.\n\n## Scaffolding and the loop\n\nClaude 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.\n\nThe 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.\n\n## What came out\n\nAlong 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.\n\nTo 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.\n\nSources:\n- https://github.com/Dream-Atelier/kl-eod-decomp\n- https://gambiconf.substack.com/p/starting-a-decompilation-project",
  "ai_use_excerpts": null
}
