Would it make sense to include the complete prompt that generated the code with the code?
It would need to be more than that. A prompt for one model can have different results vs another. Even when the model has different treatment for inference, eg quantization, the same prompt for the unquantized and quantized model could differ.
Even more so, when you come back to understand in a few years, the model will no longer be available