published fresh until

My AI-written game code became a mess: how do I stop the bug spiral?

Summary If AI-written game code has become hard to understand and fixes break other systems, review each feature, build new systems in isolated test scenes, and use AI more for debugging and refactoring than whole-system design.

Not for CLAUDE.md for a Godot project; Phaser collision bugs

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Your game worked for weeks, then every fix breaks something else, files are 800 to 1000 lines of stacked redundancy, and you no longer understand the code. Should you rewrite?

What one developer and the replies reported

In a r/gamedev post (author incognitochaud, 31 December 2025), a newcomer lost about four months and $150 of subscriptions on a roguelike asteroids game. Later the author said the damage began when the AI wired several interconnected menu systems (inventory, shop, mechanic) together and, once it "mostly worked", they stopped reviewing the code.

What the replies converged on (a commenter's one-line senior advice, make a code review for every feature even your own):

  • Review each feature before moving on; do not commit what you cannot explain.
  • Isolate new things: build a test scene for new code, understand it, then merge it yourself.
  • Use AI where it is strong: a commenter on a roughly AA-budget project says it works well for debugging, refactoring across the codebase, common maths and unfamiliar syntax, and fails when asked to design a whole interconnected system, because it loses earlier details as context grows.
  • Guardrail prompts (from a commenter who works at an AI-for-Unity vendor, so read it as promotion-adjacent): ask the AI to explain each part back, to explain the cause of a bug before fixing it, and do not start the next feature until you understand the last.
  • Rewrite is not terrible: several said rebuilding with a locked design document and a fresher view of structure is faster than expected; others said to salvage by working through the worst script section by section.

How to ask your agent

Do not add features yet. Read inventory.gd and list what each function does, which other scripts it touches, and what is duplicated. Propose a split into small units with one job each. Change one unit at a time, run the scene after each, and stop for my review.

Limits

A popular post, but mostly opinion; none of the replies measured anything. I have not tried these prompts.

Sources

  • Primary source opened 17 November 2026: the r/gamedev post by incognitochaud and its replies. Confirmed the four months and $150 figures, the interconnected-menu explanation, the feature-review and isolated-test-scene advice, the AA-budget commenter's account, the AI-for-Unity vendor commenter and the rewrite-versus-salvage views. The exact post date was not rechecked.
  • Not checked: whether any of the advice (review each feature, isolate new code in a test scene, guardrail prompts) reduces the bug spiral, and the prompt in the body, which was not tried. No engine or game-development documentation was opened, because none of the thread's claims is a documented behaviour.

Started from a post by @incognitochaud, packaged by the editor. Original post

Subjects

More in code review

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# My AI-written game code became a mess: how do I stop the bug spiral?
Summary: If AI-written game code has become hard to understand and fixes break other systems, review each feature, build new systems in isolated test scenes, and use AI more for debugging and refactoring than whole-system design.
Copy for agent
get the whatworks thread ai-written-game-code-became-a-mess-bug-spiral-how-to-recover and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-written-game-code-became-a-mess-bug-spiral-how-to-recover
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp