The Messenger of Allah ﷺ mentioned that he intended to perform itikaf during the last ten days of Ramadan. Ayesha asked his permission to join him in itikaf, and he granted it. Hafsa then asked Ayesha to seek permission for her as well, which she did. When Zaynab bint Jahsh saw this, she ordered a tent to be set up for her, and it was set up.She said, whenever the Messenger of Allah ﷺ finished his prayer, he would go to his own tent. He noticed the tents and asked, "What is this?"They replied, "These are the tents of Ayesha, Hafsa, and Zaynab."The Messenger of Allah ﷺ said, "Is it righteousness they intended by this? I will not perform itikaf."He returned, and when he had broken his fast, he performed itikaf for ten days in Shawwal.
أن رسول الله ﷺ ذكر أن يعتكف العشر الأواخر من رمضان، فاستأذنته عائشة فأذن لها. وسألت حفصة عائشة أن تستأذن لها، ففعلت. فلما رأت ذلك زينب بنت جحش أمرت ببناء فبني لها قالت: وكان رسول الله ﷺ إذا صلى انصرف إلى بنائه فبصر بالأبنية فقال: ما هذا. قالوا: بناء عائشة وحفصة وزينب. فقال رسول الله ﷺ: آلبر أردن بهذا؟ ما أنا بمعتكف. فرجع فلما أفطر اعتكف عشرا من شوال.
Bukhari narrated it in itikaf (2045), and Muslim in fasting (6:1172), both through Uzai, from Yahya bin Saeed (that is, the Ansari), from Amra bint Abdul-Rahman, from Ayesha. The wording is Bukhari's.In a narration of Muslim through Abu Muawiya, from Yahya bin Saeed, with the same chain, it contains, "until he made itikaf in the first ten days of Shawwal."Bukhari also narrated it in another place (2034) from Abdullah bin Yusuf, from Malik, from Yahya bin Saeed, with the same chain, in a similar wording.It is also found in Muwatta Yahya Laythi, in itikaf (7), through Ziyad, from Malik, from Ibn Shihab, from Amra, "The Messenger of Allah ﷺ wanted to make itikaf..." and the hadith continues.This is how it appears in the printed edition, with the addition of "Ziyad," who is Ibn Abdul-Rahman. Our teacher Mustafa Azami noted that this addition is confirmed in the Turkey manuscript, which he labeled (Q), and he said of this manuscript, "This manuscript contains the hearings of major scholars of hadith such as Husayni and Ibn Hajar and others, unlike the other manuscripts, which contain no such hearings."What appears likely is that this addition was also not confirmed in the manuscript that Ibn Abdul-Barr relied upon, and so he found fault with Yahya Laythi for misidentifying Malik's source, saying in Tamhid (11/189), "This is a mistake and a gross error that none of the transmitters of the Muwatta followed him in, saying 'from Ibn Shihab.' Rather, in the Muwatta it is from Malik, from Yahya bin Saeed, except that the transmitters of the Muwatta differed over whether it was disconnected and over its chain. Some of them narrate it from Malik, from Yahya bin Saeed, 'that the Messenger of Allah ﷺ...' without mentioning 'Amra,' while others narrate it from Malik, from Yahya bin Saeed, from Amra, from Ayesha, connecting it with its full chain." End of quote.A note, the hadith appears connected through Ayesha in Muwatta Laythi in the edition edited by Fuad Abdul-Baqi (6), and this is an error. The correct version, in the narration of Laythi, is without any mention of "Ayesha," as found in the Azami edition referred to earlier, and likewise in Tamhid.This chapter contains evidence for the permissibility of women's itikaf in the masjid, because the Prophet ﷺ did not forbid them from making itikaf in the masjid. Rather, he permitted Ayesha and Hafsa to do so at first, then when Zaynab
pitched her tent, he forbade them because of the large number of tents, so that the masjid would not become too crowded for those praying.See for more, Minna Kubra (3/463).It is not permissible to have intimate contact with women during itikaf at night, the time in which Allah has made sexual intercourse lawful, whether that takes place in the masjid or in houses, according to the Hanafi school. Likewise, ejaculation with desire without intercourse, such as masturbation, or intimate contact with one's wife other than through intercourse, are among the things that invalidate itikaf.