When Allah accepted the repentance of Kaab bin Malik, he came to the Messenger of Allah ﷺ and said, "Allah saved me only through truthfulness, and part of my repentance to Allah is that I will never lie again. I also wish to give up all my wealth as charity for the sake of Allah and His Messenger."The Messenger of Allah ﷺ said to him, "Keep some of your wealth for yourself, that is better for you."Kaab replied, "Then I will keep my share from Khaybar."
حدثنا روح حدثنا ابن جريج قال أخبرني ابن شهاب
أن كعب بن مالك لما تاب الله عليه أتى رسول الله ﷺ فقال إن الله لم ينجني إلا بالصدق وإن من توبتي إلى الله أن لا أكذب أبدا وإني أنخلع من مالي صدقة لله تعالى ورسوله فقال له رسول الله ﷺ أمسك عليك بعض مالك فإنه خير لك قال فإني أمسك سهمي من خيبر
Its isnad is sahih. The hadith "Keep your property for yourselves" has already appeared at 15114. As for this one, it will come in fuller form shortly, and the reason for it was his staying behind from the campaign of Tabuk.