So who did write about Moses' death as it is recorded in Deuteronomy 34?
Here are three reasonable options:
First, Moses himself could have written those words because God had already told him that he was going to die. God even told him when he would die.
Here is that conversation:
48 On that same day the Lord spoke to Moses,
49 “Go up Mount Nebo in the Abarim range in the land of Moab, across from Jericho, and view the land of Canaan I am giving the Israelites as a possession.
50 Then you will die on the mountain that you go up, and you will be gathered to your people, just as your brother Aaron died on Mount Hor and was gathered to his people."Deuteronomy 32
As always, Yahweh was crystal clear about what was going to happen to His servant Moses…