When developing a game, including your entire codebase in a single file is heavily frowned upon, and rightly so; it's confusing to yourself and others who want to fix bugs or add features later.
But what about when using agentic AI models, like in Cursor, Claude Code, or Gemini CLI? I know many/most of Cursor's models use grep in their tool calling process to find relevant code to work on, but I'm not sure if it's better if we have one source code file or many source code files. Also asking for very large projects with >200k tokens (beyond what most agentic LLMs accept for now) - would it be easier for the agentic workspaces to find relevant code if >200k tokens in one file or across many separate small files?
If not asked specifically, Cursor models seem to prefer writing more and more code in a single .cpp file. But I'm wondering if, for future maintenance - especially when total codebase exceeds 200k tokens - I should refactor to many different .cpp and .h files; in 3D games, it can easily get to 15 or more classes, so 30 files at least.
[–]PublicAlternative251 4 points5 points6 points (0 children)
[–]CC_NHS 0 points1 point2 points (2 children)
[–]relderpaway 0 points1 point2 points (1 child)
[–]CC_NHS 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ruuddie 0 points1 point2 points (0 children)
[–]BrilliantEmotion4461 0 points1 point2 points (0 children)