In order to explain this entire subject, let me pose several more questions. First of all, why does the Rambam omit these oaths from his Mishneh Torah? They are stated in the Gemara without any dissenting opinion. Rav Yehuda and Rabbi Zeira disagree only on whether the oaths apply to an individual or not, but regarding mass immigration and forcing the end, no opinion anywhere in the Talmud disagrees. [Even Reish Lakish in Yoma 9b only disagrees regarding the time of the Second Temple, but during our current exile he agrees with the oaths. See Siman 12.] Furthermore, all the Midrashim are full of references to the oaths. So why did the Rambam omit them?
Now, as for the other poskim [i.e. the Tur and Shulchan Aruch], one can understand the omission, because the situation to which the oaths apply does not occur often, only once in a very long time, and the poskim usually leave out such laws. This is similar to the idea expressed in Sanhedrin 51b, when one of the Amoraim issued a ruling relating to capital punishment, and another Amora asked incredulously, “Are you ruling halacha for the moshiach?” In other words, areas of halacha that will only apply when moshiach comes are for study only, not for halachic ruling. Presumably we will let moshiach’s court rule the halacha when the time comes. This is reason why the Tur and Shulchan Aruch only cover areas of halacha that apply nowadays. Similarly, the Three Oaths, although they apply by definition before moshiach, since the situation to which they apply arises only once in a very long time, the Shulchan Aruch does not include them.
Or, perhaps there was no need to mention it because it is so obvious. This is what commentators on the Shulchan Aruch say in other places. [For example, the 13 Principles of Faith are not included in Shulchan Aruch. See Mishnah Berurah, Biur Halacha on Orach Chaim Siman 1, who feels the need to supplement the Shulchan Aruch with at least the six constant commandments, which involve faith.] However, for the Rambam these answers are insufficient, because the Rambam’s methodology is to bring all laws – even those that will only apply when moshiach comes, and even matters of faith.
Now, in his introduction to Sefer Hamitzvos the Rambam writes that in his great work (meaning the Sefer Hayad, Mishneh Torah) he includes all the laws and regulations of the Torah, such that nothing is missing from it. “There is no question of law that I fail to mention, or at least mention the principle from which it can be derived.” In other words, there are things that he does not mention explicitly, but rather relies on the fact that he mentions the principle from which that law can be derived. So we much analyze the Rambam’s work and determine where he writes the principle of the matter, such that one can infer from there his opinion on the question of the oaths.
In his Letter to Yemen, the Rambam writes at length about the coming of moshiach. There he strongly warns against violating the oaths, and writes that such a violation would be extremely dangerous, G-d forbid. Now, we do not know which of two – Sefer Hayad or the Letter to Yemen – the Rambam wrote last. [The last one he wrote would be more authoritative because it would show the Rambam’s considered halachic opinion on the subject.]
The Rambam writes many things in the Letter to Yemen that seem, at first glance, to contradict what he writes in Yad. However, upon deeper consideration, one will see that there is no contradiction. In the same way, I will soon resolve nicely, with Hashem’s help, the question of why he doesn’t mention the oaths in the Sefer Hayad.
If there were really some contradiction between the Letter to Yemen and Sefer Hayad, there would be room for uncertainty as to which one we follow. The Radvaz v. 7 siman 25, in the middle of a responsum dealing with the Rambam’s opinion on a certain matter, writes, “You must know that even if you are correct that the Rambam’s letter contradicts his ruling in Yad, we follow the letter because it was written as a ruling on a practical case.” But there are some who disagree with the Radvaz. Similarly, there is a great dispute regarding what to do when the Rosh in his halachic work contradicts his responsum.
But this is only when there is an explicit contradiction. Here, however, where the Rambam in his letter writes at great length to explain the matter with its reasons, quoting from the Talmud, while in the Sefer Hayad he writes nothing at all, we would certainly follow the explicit letter.
The Chacham Tzvi in Siman 14 writes regarding a certain contradiction in the words of the Maharik that we follow the place where he explains the reasons for his decision and cites proofs. He bases this on Menachos 52a, where the Gemara considers which version of a dispute between Rabbi Yehuda and Rabbi Shimon was written later and is thus more accurate. Rabba Zuti brings Rav Ashi proof from a Baraisa in which Rabbi Shimon derives his opinion from a verse. Rashi explains that since he brings proof from a verse, this must be the latest, most authoritative version.
If so, all the more so in this case, where the Rambam in his responsum writes at length to explain his source, and in Sefer Hayad he writes nothing. The Terumas Hadeshen makes a similar argument. See the Bach in Even Hoezer Siman 96 who writes that although he holds that the Rosh’s halachic work is more authoritative than his responsa, that is only when there is an explicit contradiction, but in a case where it is not explicit and can only be inferred (from the fact that he quotes an opinion in his halachic work and does not say that he disagrees), perhaps we should follow his responsa. This is all the more true when one of the places is merely an omission (such as the case of the Rambam and the oaths): this is not cause for us to reject what he writes explicitly in a letter. And the Chacham Tzvi went even further than this, as stated above [that where a posek in one place brings a proof and in the other place he does not, the halacha follows the place where he brought a proof].
But besides all of the above, we should consider the Letter to Yemen more authoritative, for the Rambam’s letter to the community of Marseilles, printed in the Letters of the Rambam, was written in his old age after he had already published all his works, as can be seen from the fact that he quotes from his Sefer Hayad and from Moreh Nevuchim. At the end of that letter he turns to the subject of moshiach and mentions that he wrote to the land of Yemen about three booklets about the king moshiach, his identifying criteria and the signs of the time when he will appear. The Rambam recounts that he warned the Jews of Yemen to warn this messianic pretender not to bring destruction upon himself and the community, G-d forbid. So we see clearly that the Rambam affirmed everything in the Letter to Yemen at the end of his life, after writing all his works. Evidently he did not retract any position expressed there, so it is the authoritative text.
But we need not dwell on this, because there is no contradiction at all between the Letter to Yemen and the Sefer Hayad, as anyone who studies the Rambam’s sources carefully will see.
The Rosh writes (Teshuvos Klal 31 paragraph 9) that those who rule halacha from the Rambam without knowing the Gemara behind it, to understand how the Rambam derived his ruling, are certainly going to err and permit the forbidden, or forbid the permitted. This is because the Rambam writes his code without giving any reasons or proofs, so whoever reads it thinks he understands it, but it is not so; without knowledge of the Gemara, one cannot understand it properly. See how he goes on at length in this vein. The Rivash, in his Teshuvos siman 44, quotes these words of the Rosh and strongly agrees.
The Rambam himself makes a similar statement in his introduction to Moreh Nevuchim:
One should not hasten or jump to disprove my words, for perhaps what he understands from my words is actually the opposite of what I intended. My aim was to help him, but his understanding of my words may harm him.
Accordingly, we must study the Rambam carefully so as not to derive a conclusion that is the antithesis of his true opinion. Only after studying the sources of the Rambam in the Talmud, as well as the other Rishonim, can one understand his true intent.
[In summary, there are 5 reasons to follow the Letter to Yemen regarding the oaths, although the Rambam omits them from his Sefer Hayad.
1. His letter to Marseilles, written near the end of his life, affirms the content of the Letter to Yemen.
2. The Rambam may actually have not omitted the oaths from Sefer Hayad: possible they can be derived from a principle he states.
3. Even when there is an explicit contradiction, the Radvaz holds that we follow the responsum over the Sefer Hayad.
4. When one text explains more than its contradictory text, we follow it (Chacham Tzvi), and in this case the Letter to Yemen explains more.
5. When one text is not explicit, but only an inference, we follow the explicit text (Bach). All the more so here where it is not even an inference, just an omission.]