Future in the Torah
If Moses received the Torah at Mount Sinai seven weeks after the Jews left Egypt, how does the Torah describe events that took place long after that during the forty years that the Jews wandered in the wilderness?
This is a very good question and one which the Sages of the Talmud themselves addressed and answered.
When we say that Moses received the entire Torah at Sinai, it doesn’t mean that he wrote it there. Rather the understanding is as follows:
G-d revealed to Moses at Sinai as much as was humanly possible to understand about the Torah. This included understanding of the nature of G-d, Creation and its purpose, the spiritual realm and the soul, the commandments and their details, ethical teachings, and much, much more. In short, G-d taught Moses the entire body of knowledge that we refer to generally as “Torah” which is much larger that the actual words of what we refer to as the Five Books of Moses. But Moses did not write this down (we find no mention of his having prepared or having brought up the necessarily materials); rather G-d “downloaded” this vast body of knowledge called Torah into Moses during his forty days on the Mount.
Now G-d may have revealed to Moses at Sinai certain events in the future, but even without Moses’ writing them down this is problematic. For one, if Moses was told of future events, he would have warned the Jews against making future mistakes such as serving the golden calf. Lest we suggest he knew but didn’t want to interfere with G-d’s will, that would mean he knowingly went through the motions of his own mistake thereby barring his entry into the Land of Israel. This seems highly unlikely and G-d would not have tampered with free will in this way. Also, the actual events as recorded in the Torah are described in past tense.
So if G-d didn’t reveal these future events to Moses, or at least Moses didn’t write them at Sinai, the real question is, “Who wrote the Written Torah and when?”
According to one opinion in the Talmud (Gittin 60a), regarding the historical information that G-d revealed to Moses at Sinai, He taught him from Creation until that time. When Moses came down from the Mount, he wrote that in what became the books of Genesis and Exodus. From then on, Moses wrote the rest of the Five Books piecemeal — as events occurred and as teachings were revealed — in wording dictated by G-d. According to another opinion, G-d dictated the Five Books to Moses at the end of the fortieth year in the wilderness. In the view of both opinions, whatever G-d revealed to Moses at Sinai but was not written remained as the Oral tradition.
This, therefore, is the answer to your question. G-d revealed to Moses at Sinai the entire body of knowledge called Torah, which did not necessarily include foresight of what would become all historical events. Parts of this body of knowledge, together with the historical events as they occurred, were written later by Moses as commanded by G-d.
One interesting exception to this, to which your question also applies, is regarding the description of Moses’ death in the last eight verses of the Torah. If Moses recorded events as they occurred, how did he write, “And Moses died”: If he was alive to write, he didn’t die; and if he died, how did he write?
The Sages also discuss this question in the Talmud (Menachot 30a). According to one opinion, until that point, Moses wrote; from here on, Joshua wrote. This fits your premise that Moses did not write about future events. However, another opinion posits that given that Moses wrote the entire Torah, we must explain that until that point Moses wrote [normally]; from here on Moses wrote in tears. This explanation seems to mean that Moses wrote the entire Torah, including the description of his future death, which he wrote while crying.
Parenthetically, a modern-day commentary found this latter explanation difficult. For one, Moses’ writing in the Torah that he died while still alive would make the Torah false, G-d forbid. Furthermore, the truth and power of the Torah are such that if he wrote, “And Moses died”, he would, in fact, have died. For these reasons, this commentary explains the opinion “from here on Moses wrote in tears” to mean that unlike the rest of the Torah which Moses wrote in ink, regarding the final passages in which G-d revealed to Moses his death, Moses dipped his quill in puddles of his tears and stenciled the concluding verses on the parchment with his teardrops. After his death, Joshua then filled in the stenciled verses with ink. This way, Moses wrote the entire Torah in a way which wouldn’t cause his death, while his mission was completed by Joshua who filled in the void of his death.