Developer Victor Ribeiro recently demonstrated the practical utility of agentic coding by using Claude Code to refactor and extend aimAndShoot, a 2019 browser-based game featuring bots controlled by neural networks. The experiment involved fixing bugs that held back the neuroevolution and implementing shared server-side learning. The result is a significant technical overhaul that transforms a local-only curiosity into a persistent, server-backed evolutionary simulation.

From Local Curiosity to Shared Evolution

The most substantial change implemented by Claude Code is the shift from isolated, local evolution to a shared server-side population. Previously, the bots were reset when the player died. The new architecture, backed by PHP and SQLite, maintains a global population of bots that evolves across all players. The server now handles the scoring and breeding of the next generation, while the browser only reports how each bot did in the round. This ensures that improvements made by one player persist for the next, creating a cumulative intelligence that outlasts individual sessions. If the server can't be reached, the game falls back to evolving the bots locally, as before.

Fixing the Fitness Function and Mutation Logic

Ribeiro’s original 2019 implementation suffered from fundamental flaws in its genetic algorithm, particularly regarding how bots learned to aim and fire. The AI-assisted refactor fixed critical bugs where mutation previously scrambled neural weights rather than fine-tuning them, and where the fitness function inadvertently rewarded bots for spraying bullets indiscriminately. The updated code ensures each bot sees every player and its own state, with aim mechanics covering the entire arena. Furthermore, the best-performing bot from each generation is now preserved, preventing the loss of highly adapted traits due to stochastic failure in subsequent rounds.

Quality-of-Life Improvements and Gameplay Balance

Beyond the core AI architecture, the refactor addressed numerous gameplay issues identified in the original 2019 Hacker News thread. The game now includes a grace period at the start of each round to prevent instant deaths, fixed movement speeds independent of screen refresh rates, and a scaled arena to ensure consistent collision detection. Audio was also adjusted, with quieter gunshots and a mute option, addressing common complaints about the original’s sensory overload. These changes demonstrate how an LLM can handle not just algorithmic complexity but also the subtle UX adjustments required to make a legacy game playable in a modern context.

Key Takeaways

  • Claude Code successfully handled a complex refactor of a neuroevolution algorithm, moving from local to shared server-side state management.
  • The AI fixed specific logical errors in the fitness function that previously rewarded suboptimal bot behavior like bullet spraying.
  • The project highlights the viability of using agentic tools to revive and modernize older, technically ambitious side projects.
  • Shared evolution allows the game’s AI to improve cumulatively across all users, a feature that would have required significant manual engineering effort to implement correctly.

The Bottom Line

This isn't just a game update; it's a proof-of-concept that LLMs can navigate the messy reality of legacy code and implement sophisticated architectural changes like shared state persistence without human hand-holding through every line of PHP and JavaScript.