The Prophet ﷺ came out from the toilet, and food was brought to him. They mentioned ablution to him, so he said, "Do I intend to pray, that I should perform ablution?"In another narration, We were with the Prophet ﷺ when he came back from relieving himself, and food was brought to him. He was asked, "Will you not perform ablution?" He replied, "Why? Am I about to pray, that I should perform ablution?"In another narration, he said, "Why? For prayer?"In another narration, "I do not intend to pray, that I should perform ablution."
أن النبي ﷺ خرج من الخلاء، فأتي بطعام، فذكروا له الوضوء، فقال: أريد أن أصلي فأتوضأ؟ وفي رواية: كنا عند النبي ﷺ فجاء من الغائط، وأتي بطعام، فقيل له: ألا توضا؟ فقال: لم؟ أأصلي فأتوضأ؟ وفي رواية قال: لم؟ أللصلاة؟ وفي رواية: ما أردت صلاة فأتوضأ.
Muslim narrated it in "Menstruation" (374) via Amr bin Dinar, from Saeed bin Huwayrith, from Ibn Abbas, and he mentioned the hadith. The referencing of the hadith was previously given in the chapter on the obligation of purification for prayer.