Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:4163Ismāʿīl b. Mūsá > Sharīk > Abū Isḥāq > Ḥārithah b. Muḍarrib > Ataynā Khabbāb Naʿūduh > Laqad Ṭāl Suqmī And Lawlā Annī

“We came to Khabbab to visit him (when he was sick), and he said: ‘I have been sick for a long time, and were it not that I heard the Messenger of Allah ﷺ say: “Do not wish for death,” I would have wished for it.’ And he said: “A person will be rewarded for all his spending, except for (what he spends) on dust,” or he said, “on building.”  

ابن ماجة:٤١٦٣حَدَّثَنَا إِسْمَاعِيلُ بْنُ مُوسَى حَدَّثَنَا شَرِيكٌ عَنْ أَبِي إِسْحَاقَ عَنْ حَارِثَةَ بْنِ مُضَرِّبٍ قَالَ أَتَيْنَا خَبَّابًا نَعُودُهُ فَقَالَ لَقَدْ طَالَ سُقْمِي وَلَوْلاَ أَنِّي

سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ لاَ تَتَمَنَّوُا الْمَوْتَ لَتَمَنَّيْتُهُ وَقَالَ إِنَّ الْعَبْدَ لَيُؤْجَرُ فِي نَفَقَتِهِ كُلِّهَا إِلاَّ فِي التُّرَابِ أَوْ قَالَ فِي الْبِنَاءِ  


See similar narrations below:

Collected by Tirmidhī, Suyūṭī
tirmidhi:2483ʿAlī b. Ḥujr > Sharīk > Abū Isḥāq > Ḥārithah b. Muḍarrib > Ataynā Khabbāb Naʿūduh And Qad Āktawá Sabʿ Kayyāt > Laqad Taṭāwal Maraḍī Walawlā Annī

"We went to visit Khabbab who had himself cauterized in seven places on his body. He said: 'I have been ill for so long, and if it was not that I heard the Messenger of Allah ﷺ saying: "None of you should wish for death" then I would have wished for it, and he said: "A man is rewarded for [all of] his spending except for the dust" - or he said - "in the building."  

Abū ʿĪsá said that this Ḥadīth is Ḥasan-Ṣaḥīḥ.
الترمذي:٢٤٨٣حَدَّثَنَا عَلِيُّ بْنُ حُجْرٍ أَخْبَرَنَا شَرِيكٌ عَنْ أَبِي إِسْحَاقَ عَنْ حَارِثَةَ بْنِ مُضَرِّبٍ قَالَ

أَتَيْنَا خَبَّابًا نَعُودُهُ وَقَدِ اكْتَوَى سَبْعَ كَيَّاتٍ فَقَالَ لَقَدْ تَطَاوَلَ مَرَضِي وَلَوْلاَ أَنِّي سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ لاَ تَمَنَّوُا الْمَوْتَ لَتَمَنَّيْتُ وَقَالَ يُؤْجَرُ الرَّجُلُ فِي نَفَقَتِهِ كُلِّهَا إِلاَّ التُّرَابَ أَوْ قَالَ فِي الْبِنَاءِ  

قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ
suyuti:5732a
Request/Fix translation

  

السيوطي:٥٧٣٢a

"إِنَّ الْعَبْدَ لَيُؤْجَرُ فِي نَفَقَتِه كلها إِلَّا في الْبِنَاءِ ".  

هناد، [هـ] ابن ماجة والحكيم، [هب] البيهقى في شعب الإيمان عن خَبَّاب