Decompiling an FPS with AI Agents: Lessons from 500B Tokens
A deep dive into autonomous AI orchestration, infrastructure tuning, and semantic verification.

Overview
A three-month experiment in autonomous software reconstruction has offered profound insights into the capabilities and limitations of current large language models. The project, which aimed to decompile a well-known first-person shooter into functional C++ source code, moved beyond simple proof-of-concept demonstrations. Instead, the team pursued an accurate, stable, and feature-complete recreation of the original game.
While the specific title of the game remains undisclosed due to legal pressures from corporate entities, the technical lessons derived from consuming approximately 500 billion tokens are widely applicable. The initiative was a collaborative effort involving community contributors such as RektInator, Future, and st0rm, focusing primarily on AI orchestration, infrastructure optimization, and agent management rather than the decompilation process itself.
Methodology and Infrastructure
The technical foundation of the project relied on a hybrid model strategy. Initial operations utilized Claude Max with a high parallelism setting, later supplemented by Codex Pro to allow simultaneous subscription usage. The team predominantly employed Sonnet 5 for its balance of speed and reasoning, while also integrating Opus 5.5, Luna, Sol, and Terra for specialized tasks requiring deeper analysis or different capability profiles.
Agent orchestration was split between two primary environments: Claude Code CLI for Anthropic-based agents and Codex CLI for OpenAI-based agents. Although alternative harnesses were tested, the team found that the default configurations provided sufficient stability and control, eliminating the need for complex custom wrappers.
To maintain transparency and track progress, the team implemented a rigorous issue management system using GitHub CLI. Each translation unit, corresponding to a single .cpp file, was assigned a dedicated issue. Labels were employed to group related tasks and prioritize critical paths, ensuring that the team could monitor fine-grained progress across thousands of files.
Communication was centralized through Discord. This platform facilitated both agent-to-agent and human-to-agent interaction, allowing team members to provide guidance without direct terminal access. A GitHub webhook integrated with Discord to post continuous integration failures in real-time, ensuring that agents were immediately notified when their changes broke the build.
For reverse engineering support, the team relied heavily on ida-mcp, the official middleware service from Hex-Rays. The tool’s headless operation and stability made it indispensable for providing agents with structured disassembly data.
Operational Challenges and Optimizations
During the first month, four agents operated concurrently: three dedicated to decompilation and commit generation, and one acting as a passive reviewer to flag bugs. This configuration achieved significant milestones, including a booting game, a visible main menu, and the ability to load maps. However, the pace of decompilation revealed critical inefficiencies in context management.
The default compaction threshold for AI contexts is set at 90% fill. The team discovered that decompilation tasks generate substantial volatile information; once a function is translated, it often becomes irrelevant to subsequent logic. By reducing the compaction threshold to 42%, they significantly lowered token consumption and improved agent performance.
Despite these optimizations, the team observed that agents tended to lose focus as context windows filled with historical data. Agents would frequently abandon incomplete functions to start new ones, or idle while monitoring CI status despite receiving failure notifications. In some cases, issues were closed prematurely without thorough verification of completion.
To combat this drift, the team developed a comprehensive instruction document outlining goals, workflows, and prohibited behaviors. An hourly cron job was implemented to automatically inject requests for agents to reread this document, keeping the operational guidelines fresh within their context windows. This manual steering mechanism proved essential for maintaining coherence over long autonomous sessions.
The Quality Gap: Semantic Correctness vs. Functionality
Perhaps the most critical finding of the project was the discrepancy between surface-level functionality and semantic correctness. The initial progress, characterized by the game launching and menus rendering, created an illusion of success. The generated C++ code was highly readable and compiled without errors, but it was fundamentally flawed.
Agents frequently introduced incorrect function signatures, mismatched types, and erroneous struct layouts. In several instances, they invented logical constructs where none existed or removed existing logic they deemed unnecessary. One notable architectural failure involved global configuration variables being replaced with hash table lookups. This change degraded performance by orders of magnitude, transforming simple memory accesses into expensive computational operations.
The root cause of these issues was the lack of objective acceptance criteria. While the original game served as a reference, the team’s initial desire for modernization and portability meant that certain deviations were not treated as bugs. Consequently, the reviewer agent lacked the framework to distinguish between acceptable refactoring and semantic errors.
The main reason for these failures is that we didn’t have objective acceptance criteria. We never properly defined “correctness.” Therefore it was hard for the reviewer to judge which change is correct and what’s wrong.
This experiment highlights that while AI agents can effectively manage syntax, compilation, and high-level structure, ensuring semantic fidelity requires more robust verification mechanisms than passive review alone. Future projects aiming for accurate reconstruction must prioritize precise definition of correctness before autonomous agents begin heavy lifting.
Sources
- 1
Decompiling an FPS with AI Agents: Lessons from 500B Tokens
https://momo5502.com/posts/2026-10-09-game-decompilation/
Tools mentioned
GEO Radar
https://geodetect.io
Gromore
https://gromore.io
BrandMagnet
https://brandmagnet.ai
Claude Citation Tracker
https://citation.tracker
Gemini Brand Scanner
https://gemini-brand.scanner
Ahrefs
https://ahrefs.com
SEMrush
https://semrush.com
Moz Pro
https://moz.com
SpyFu
https://spyfu.com
SERPstat
https://serpstat.com