I asked the Messenger of Allah ﷺ, "Which is better, praying in my home or praying in the mosque?"He replied, "Do you not see how close my house is to the mosque? Yet I prefer to pray in my home rather than in the mosque, unless it is an obligatory prayer."
سألت رسول الله ﷺ: أيهما أفضل؟ الصلاة في بيتي أو الصلاة في المسجد؟ قال: ألا ترى إلى بيتي؟ ما أقربه من المسجد! فلأن أصلي في بيتي أحب إلي من أن أصلي في المسجد إلا أن تكون صلاة مكتوبة.
Ibn Majah (1378) narrated it from Abu Bishr Bakr bin Khalaf, who said, "Abdul-Rahman bin Mahdi narrated to us, from Muawiya bin Salih, from Ala bin Harith, from Haram bin Hakeem, from his uncle Abdullah bin Saad," and he related something similar. Ibn Khuzayma (1202) also reported it through the route of Abdul-Rahman with the same wording. This chain of transmission was mentioned earlier in the Book of Menstruation, in the chapter on eating with a menstruating woman and sharing her leftover food and drink.It is narrated through this chain both at length and in brief. Imam Ahmad brought all these matters together in the Musnad of Abdullah bin Saad (19007), "Abdul-Rahman bin Mahdi narrated to us, from Muawiya, meaning bin Salih, from Ala, meaning bin Harith, from Haram bin Hakeem, from his uncle Abdullah bin Saad, that he asked the Messenger of Allah ﷺ about what necessitates ghusl, about the fluid that appears after the fluid, about praying in his house, about praying in the masjid, and about eating with a menstruating woman.He said, "Allah does not shy away from the truth. As for me, when I do such and such," and he mentioned ghusl, he said, "I perform ablution as I do for prayer, and I wash my private part," then he mentioned ghusl again, "so I wash my private part from that and perform ablution. As for praying in the masjid and praying in my house, you can see how close my house is to the masjid, and my praying in my house is dearer to me than praying in the masjid, unless it is an obligatory prayer. As for eating with a menstruating woman, I do eat with her."There is disagreement over the name of Haram's father. Some said it was Hakeem, as in this narration, while others said it was Muawiya, which led some biographers to assume there were two different men. But the correct view is that they are one and the same, as Khatib noted in Muwaddih Awham Jam wa-Tafriq, and as Hafiz noted in Taqrib in the entry for "Haram bin Hakeem." However, he does not reach the rank of "trustworthy," as Hafiz stated, and for this reason he graded it hasan due to the minor concern surrounding him.