Shalom kollel hayakar!
Just a weird question. In the rambam why doesn't he take the effort to mention mashiach ben yosef. The gemara mentions it.....
Shalom R' Samet,
Very nice question. There may a number of reasons.
First, some Gaonim maintain that if the Jewish people will repent, then Mashiach Ben Yosef will not necessarily come [1]. Some suggest that this could be why the Rambam chooses not to mention the issue [2].
Second, even if he will come, some commentators maintain that the process is not so clearly understood, so one cannot say too much about it [3]. It is possible that the Rambam felt there was no pressing reason to write about it.
Third, the main reason Rambam describes Mashiach at all -- at least in Mishneh Torah -- is because it is a critical article of Jewish belief [4]. Rambam even recommends that one should not too deal too much with these issues [5]; if so, perhaps we should not be surprised to see the Rambam not delve into it.
I hope this helps!
Best wishes,
Yishai Rasowsky
Sources:
1. האמונות והדעות - סעדיה בן יוסף https://hebrewbooks.org/pdfpager.aspx?req=31359&st=&pgnum=180
2. Rabbi Immanuel Schochet
https://www.chabad.org/library/article_cdo/aid/101747/jewish/Mashiach-ben-Yossef.htm
3. אור ה' - קרשקש, חסדאי בן אברהם
https://hebrewbooks.org/pdfpager.aspx?req=22063&st=&pgnum=379&hilite=
4. https://www.sefaria.org/Mishneh_Torah%2C_Kings_and_Wars.11.1?lang=he&with=all&lang2=he
5. https://www.sefaria.org/Mishneh_Torah%2C_Kings_and_Wars.12.2?lang=he&with=all&lang2=he