The "patch file" approach for LLM output on large files is spot on. I've hit the same wall and forcing targeted replacements instead of full rewrites is the only sane way past a certain codebase size. Also respect for managing state manually in 9k lines of vanilla JS without reaching for a framework.