When a woman among the Jews was menstruating, they would not eat with her, drink with her, or stay with her in the same house. The companions asked the Prophet of Allah ﷺ about this, so Allah revealed "They ask you about menstruation. Say, it is an impurity" [Baqarah 2:222], the verse.The Messenger of Allah ﷺ then instructed them to eat with menstruating women, drink with them, share the house with them, and do everything with them except sexual intercourse.
أخبرنا إسحق بن إبراهيم قال حدثنا سليمان بن حرب قال حدثنا حماد بن سلمة عن ثابث
كانت اليهود إذا حاضت المرأة منهم لم يؤاكلوهن ولم يشاربوهن ولم يجامعوهن في البيوت فسألوا نبي الله ﷺ عن ذلك فأنزل الله عز وجل {ويسألونك عن المحيض قل هو أذى} الآية فأمرهم رسول الله ﷺ أن يؤاكلوهن ويشاربوهن ويجامعوهن في البيوت وأن يصنعوا بهن كل شيء ما خلا الجماع
Muslim reported it in the Book of Menstruation, chapter on the permissibility of a menstruating woman washing her husband's head and combing his hair, etc., hadith no. 302, from the hadith of Hammad bin Salama with the same chain, and it is in Kubra, hadith no. 281.