وَعَنْهَا قَالَتْ: «إِنْ كَانَ رَسُولُ اَللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ لَيُدْخِلُ عَلَيَّ رَأْسَهُ (وَهُوَ فِي اَلْمَسْجِدِ) فَأُرَجِّلُهُ، وَكَانَ لَا يَدْخُلُ اَلْبَيْتَ إِلَّا لِحَاجَةٍ، إِذَا كَانَ مُعْتَكِفًا»
Aishah (RAA) narrated, The Messenger of Allah (sallallahu alayhi wa sallam) used to put his head into (the window of my house) while he was in the mosque (performing Itikaf) and I would comb his hair. When he was in Itikaf he would not enter the house except for some need.Agreed upon and the wording is from Al-Bukhari.