The Prophet ﷺ used to observe spiritual retreat during the last ten days of Ramadan until Allah took him, then his wives observed the retreat after him.
و حدثنا قتيبة بن سعيد حدثنا ليث عن عقيل عن الزهري عن عروة
أن النبي ﷺ كان يعتكف العشر الأواخر من رمضان حتى توفاه الله عز وجل ثم اعتكف أزواجه من بعده