Sunan al-Nasa'i
The Book of Forgetfulness (In Prayer) — Hadith #1215
أَخْبَرَنَا الْقَاسِمُ بْنُ زَكَرِيَّا بْنِ دِينَارٍ، قَالَ حَدَّثَنَا أَبُو أُسَامَةَ، قَالَ حَدَّثَنِي شُرَحْبِيلُ، - يَعْنِي ابْنَ مُدْرِكٍ - قَالَ حَدَّثَنِي عَبْدُ اللَّهِ بْنُ نُجَىٍّ، عَنْ أَبِيهِ، قَالَ قَالَ لِي عَلِيٌّ كَانَتْ لِي مَنْزِلَةٌ مِنْ رَسُولِ اللَّهِ صلى الله عليه وسلم لَمْ تَكُنْ لأَحَدٍ مِنَ الْخَلاَئِقِ فَكُنْتُ آتِيهِ كُلَّ سَحَرٍ فَأَقُولُ السَّلاَمُ عَلَيْكَ يَا نَبِيَّ اللَّهِ فَإِنْ تَنَحْنَحَ انْصَرَفْتُ إِلَى أَهْلِي وَإِلاَّ دَخَلْتُ عَلَيْهِ .
“Ali said to me: ‘I was so close to the Messenger of Allah (ﷺ), closer than anyone else. I used to come to him at the end of every night, before dawn, and say: “As-salamu ‘alayka ya Nabiyy Allah (Peace be upon you, O Prophet of Allah).” If he cleared his throat I would go back to my family, otherwise I would enter upon him.'”
Chain of Narration (Isnad)