Questions & Answers about Я записал код подтверждения в блокнот, чтобы не забыть его.
Записал is the perfective past form of записать, so it presents the action as completed: the speaker wrote the code down successfully.
- Я записал код... = I wrote the code down
- Я записывал код... would sound more like I was writing down the code / I used to write down the code, focusing on the process or repeated action
In this sentence, the point is that the action was done once, as a completed step, so записал is the natural choice.