Bara bin Azib reported,

We went out with the Messenger of Allah ﷺ for the funeral of a man from the Ansar. When we reached the grave, the niche had not yet been dug. The Messenger of Allah ﷺ sat down, and we sat around him so still that it was as though birds were perched on our heads. In his hand was a stick with which he was poking the ground. Then he raised his head and said, "Seek refuge in Allah from the punishment of the grave," repeating it two or three times.In Jareer's version, the following is added at this point, "He hears the shuffling of their sandals as they turn away when he is asked, 'You there, who is your Lord? What is your religion? Who is your prophet?'"

Azami 3826

Hasan

عن البراء بن عازب قال

خرجنا مع رسول الله ﷺ في جنازة رجل من الأنصار، فانتهينا إلى القبر، ولم يلحد فجلس رسول الله ﷺ وجلسنا حوله كأنما على رؤوسنا الطير، وفي يده عود ينكت به في الأرض، فرفع رأسه فقال: استعيذوا بالله من عذاب القبر مرتين أو ثلاثا زاد في حديث جرير ههنا وقال: وإنه ليسمع خفق نعالهم إذا ولوا مدبرين حين يقال له: يا هذا من ربك؟ وما دينك؟ ومن نبيك؟

الأعظمي 3826حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Conditions of the deceased in the grave
Section
Deceased hears the shuffling of sandals
Numbering
Jami al-Kamil 3826 (2nd edition)
Azami 3826