Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

How to Build a 114,000-Line Game with AI: Context Management in Practice

A browser game of 114,000 lines, written entirely with neural networks in three weeks, is a real thing. But the main difficulty turned out not to be whether AI can write code. It was keeping a large project manageable once the codebase had long outgrown any context window. The author lays out his methodology step by step.

AI-processed from Habr AI; edited by Hamidun News
How to Build a 114,000-Line Game with AI: Context Management in Practice
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Strict modularity — files are deliberately kept small so that each one fits into the context window on its own. No three-thousand-line files.
Key metric #2Session briefings — every new session starts with a short introduction: what has been done, which conventions are in force and what is being worked on right now.

A developer wrote a 114,000-line browser game entirely with neural networks, and finished in three weeks. This is not a showcase of AI power. It is a practical breakdown of a methodology: how to keep a large project manageable once the codebase no longer fits in the context window.

Three weeks and 114,000 lines

A browser game is not a toy project. Writing 114,000 lines of code alone in three weeks is a pace that would be unattainable without neural networks. The author did not use AI as an autocomplete assistant. He used it as a full-fledged generator: he described tasks in natural language, received implementations, iterated on the results and moved on.

But by the midpoint of the work, it was clear that generation speed is not the main problem in a large AI-assisted project. The main problem is manageability. The bigger the codebase, the harder it is to explain to the model what is already implemented, which decisions are settled and what it must absolutely not do. The model does not remember which patterns were chosen two sessions ago. It does not know that a function has already been written in another file.

When the context runs out

The context window is a fundamental limit of a language model working on a large project. Even for the most powerful models it is finite: thousands of lines of code, multiplied by comments and documentation, quickly exceed the available capacity. Once a project grows past a few dozen thousand lines, the model physically cannot hold the entire repository in memory at once.

The consequences are predictable. The AI starts inventing functions that already exist in another file, conflicts with architectural conventions adopted early on, and ignores a naming style introduced a couple of sessions ago. The code compiles, but its internal logic begins to drift apart.

This is not a model bug. It is a structural problem that requires a structural solution on the developer's side.

How to keep the project under control

A few principles that worked in practice:

  • Decision documentation outside the code — every architectural decision is recorded in a separate document. Before a new session, the AI receives it as part of the context together with the task.
  • Strict modularity — files are deliberately kept small so that each one fits into the context window on its own. No three-thousand-line files.
  • Session briefings — every new session starts with a short introduction: what has been done, which conventions are in force and what is being worked on right now.
  • Uniform naming conventions — a strict style for functions, variables and modules reduces the risk of collisions that the AI does not notice without an explicit reminder.
  • "Blind" reviews — periodically asking the model to explain code it wrote itself. This is a good way to uncover hidden contradictions and logical drift between sessions.

None of these principles is new: all of them are used in team development to coordinate people. With AI they work differently, as a mechanism for managing the model's attention. Not "who is responsible for what," but "what the model knows right now and which of that matters."

What this means

114,000 lines in three weeks is a reproducible methodology, not a one-off feat. AI can write code at industrial scale, but the manageability of a large project still depends on the human. Structure, documentation and deliberate context management are what separate a project that can be continued and developed from a codebase that no one can make sense of anymore, including the model itself.

Story

Key Questions Answered

What are the key details on Three weeks and 114,000 lines?

A browser game is not a toy project. Writing 114,000 lines of code alone in three weeks is a pace that would be unattainable without neural networks. The author did not use AI as an autocomplete assistant. He used it as a full-fledged generator: he described tasks in natural language, received implementations, iterated on the results and moved on. But by the midpoint of the work, it was clear that generation speed is not the main problem in a large AI-assisted project. The main problem is manageability.

When the context runs out?

The context window is a fundamental limit of a language model working on a large project. Even for the most powerful models it is finite: thousands of lines of code, multiplied by comments and documentation, quickly exceed the available capacity. Once a project grows past a few dozen thousand lines, the model physically cannot hold the entire repository in memory at once. The consequences are predictable.

How to keep the project under control?

A few principles that worked in practice: Decision documentation outside the code — every architectural decision is recorded in a separate document. Before a new session, the AI receives it as part of the context together with the task. Strict modularity — files are deliberately kept small so that each one fits into the context window on its own. No three-thousand-line files.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Private AI Builders Community · Vibe Club

Ship AI Faster with Founders, Engineers & Weekly Architecture Reviews

Inside Vibe Club (hamidun.com/club) — weekly live masterminds with Zhemal Khamidun, Tech Radar, full LMS access, and 370+ production Claude Code skills.

Join Vibe Club →Free intensive — waitlist
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — How to Build a 114,000-Line Game with AI: Context Management in Practice https://news.hamidun.com/en/news/10805/how-to-build-a-114-000-line-game-with-ai-context-management

What do you think?
Loading comments…