Test: M3.1 Flash split a 1,564-line single file into 13 files for 17 cents in 18.5 minutes
Using three subagents (two reading code, one verifying), the author screenshotted old features and wrote passing Playwright tests as an answer key, split the file piece by piece committing only on green tests, then ran jscpd to dedupe, knip to delete dead code, and moved hard-coded keys to a gitignored .env with rotation; about 17 cents at API prices in 18.5 minutes.
𝟭𝟳 𝗰𝗲𝗻𝘁𝘀 at API prices. 18.5 minutes. That's all it took M3.1 Flash to split a 1,564-line single-file monster into 13 files and throw in a settings panel. Yes, the mystery model that topped OpenRouter for 10 days. To clean up your own project, have it send out 𝟯 𝗰𝗼𝗽𝗶𝗲𝘀 𝗼𝗳 𝗶𝘁𝘀𝗲𝗹𝗳 (subagents), two to dig through the code and one to check the work: → Before you touch anything, screenshot every feature and write the core flows as Playwright tests that pass on the old version first. That's your answer key → Split one piece at a time and run the tests after each. If they pass, commit. If something breaks, go straight back to the last commit → Run npx jscpd to find copy-pasted code and merge it, run npx knip to find what nothing uses and delete it, and move hard-coded keys into a gitignored .env, then rotate them
This post quotes another post: x.com/minimax_ai/status/2112150867868541221