You could use snapshots or whatnot to reset the state whenever you like. Using an LLM to clean up files often seems like overkill to me.
So you only snapshot the rest. (And since your source tree is under version control, finding stray garbage there is straightforward unless you checked it in)