Well, I don't disagree with what you typed there but I think we're off in the weeds a bit.
"how can we make it so that 100% of the production
code is the only code I typed?"
We certainly want to eliminate as many unnecessary steps as possible.But much of that intermediate work iteration is inseparable from the discovery and refinement process.
To answer your question literally, "how can we make it so that 100% of the production code is the only code I typed?" would only be possible if you moved all of that discovery and iteration and refinement out of the coding loop or whatever.