Whenever the Prophet ﷺ intended to perform itikaf, he would pray the dawn prayer and then enter the place where he wished to seclude himself. He decided to observe itikaf during the last ten days of Ramadan, so he gave orders for a tent to be set up for him.Ayesha then asked for a tent to be pitched for her, and one was set up. Hafsah asked for a tent to be pitched for her as well, and it was done. When Zaynab saw their tents, she too requested a tent, and one was pitched for her.When the Messenger of Allah ﷺ saw this, he said, "Is it righteousness you are seeking?" He did not perform itikaf during that Ramadan, and instead observed itikaf for ten days in Shawwal.
حدثنا أبو بكر بن أبي شيبة حدثنا يعلى بن عبيد حدثنا يحيى بن سعيد عن عمرة
كان النبي ﷺ إذا أراد أن يعتكف صلى الصبح ثم دخل المكان الذي يريد أن يعتكف فيه فأراد أن يعتكف العشر الأواخر من رمضان فأمر فضرب له خباء فأمرت عائشة بخباء فضرب لها وأمرت حفصة بخباء فضرب لها فلما رأت زينب خباءهما أمرت بخباء فضرب لها فلما رأى ذلك رسول الله ﷺ قال آلبر تردن فلم يعتكف رمضان واعتكف عشرا من شوال
Bukhari narrated it in itikaf, chapter on the itikaf of women, no. 2033, 2034, 2041, 2045, and Muslim in itikaf, chapter on when one intending itikaf should enter his place of itikaf, no. 1173, through various routes from Yahya bin Saeed, from Amrah, from Ayesha, in like manner.