He came up to the Kaabah after the Prophet ﷺ had entered it along with Bilal and Usama bin Zayd, and Uthman bin Talha had shut the door upon them. They remained inside for a long while, then the door was opened and the Prophet ﷺ came out.Ali said, "I climbed the steps and entered the House, and I asked, 'Where did the Prophet ﷺ pray?'"They replied, "Right here."But I forgot to ask them how many units of prayer he had performed inside the House.
أخبرنا محمد بن عبد الأعلى قال حدثنا خالد قال حدثنا ابن عون عن نافع
أنه انتهى إلى الكعبة وقد دخلها النبي ﷺ وبلال وأسامة بن زيد وأجاف عليهم عثمان بن طلحة الباب فمكثوا فيها مليا ثم فتح الباب فخرج النبي ﷺ وركبت الدرجة ودخلت البيت فقلت أين صلى النبي ﷺ قالوا ها هنا ونسيت أن أسألهم كم صلى في البيت
Muslim narrated it in the Book of Hajj, in the chapter on the desirability of entering the Kaaba for the pilgrim and others, hadith no. 1329/392, from the hadith of Khalid bin Harith through this same route. It is also in Al-Kubra, hadith no. 3888. It is agreed upon [by Bukhari and Muslim], from the hadith of Nafi through this same route, as mentioned previously at hadith no. 0750.