This has already been done.
https://github.com/Kuberwastaken/claurst
They got one AI agent to read the code and output documentation (a specification) that contained no actual code.
Then they fed that to a second AI agent and asked it to implement that specification in Rust. Technically, this is a cleanroom implementation.
This is interesting from a legal perspective because it leverages the same legal loophole that Anthropic rely on for their own operations. They can't take down this repo without creating a precedent that will be used against them.
Oh, I've definitely written code like that before.