It was narrated to us by al-assan bin ʿAbd Allāh bin Saʿīd al-ʿAskari, who said – it was narrated to us by Abū Bakr Moammed bin al-assan bin Darīd, who said – it was narrated to us by Abū al-atm, from al-ʿAtabi (i.e. Moammed bin ʿUbayd Allāh), from his father, who said – and it was also reported to us that ʿAbd Allāh bin Shabīb al-Bari, who said – it was narrated to us by Zakariyya bin Yaya al-Monqari, who said – it was narrated to us by al-ʿAlā’ bin al-Fadhl,1 from his father, from his grandfather, who said – Qays bin ʿĀim said:

I visited the Prophet صلى الله عليه وآله with a group of people from the tribe of Tamīm, and we entered and with him was al-Ṣalṣal bin al-Dalhamas. I said to him: “Oh Prophet of Allāh, advise us on a topic that will benefit us, for we are a people who dwell in the desert wasteland.”
The Messenger of Allāh صلى الله عليه وآله said: “Oh Qays, indeed with conceit comes humiliation, and indeed with life comes death, and indeed with this worldly life (al-Dunya) comes the afterlife (al-Ākhira), and indeed for everything there is accountability, and over everything there is a guardian, and indeed for every good [deed] there is a reward, and for every evil [deed] there is a punishment, and for every appointed term it is written.
“Indeed it is a certainty there will be for you, Oh Qays, a companion who will be buried with you and he will be alive, and you will be buried with him while you are dead. So, if he was honourable, he will honour you, and if he was depraved, he will degrade you. Then he will not be resurrected except with you, and you will not be resurrected except with him. You will not be questioned except through him, so do not take him [as a companion] anyone other than a righteous [person]. Indeed, for if he were righteous, you will find cordiality in him, but if he were depraved, you would not feel desolate except from him. He (the companion) is your deeds.”
He (the narrator) said: “Oh Prophet of Allāh صلى الله عليه وآله, I would love that these words were to be put in a few verses of poetry, so that we glorify them upon those arabs who are nearby to us, and also preserve it. So the Prophet6ordered Ḥisān to do so.”
He (al-Ṣalṣal bin al-Dalhamas)2 said: “At this point, I embarked on pondering over a poetry that was similar to this exhortation, so I settled upon a statement before Ḥisān arrived, so I said: Oh Messenger of Allāh صلى الله عليه وآله, I have arranged some verses that I consider consistent what you want, so I recited to Qays:

You choose your company by your actions so that,
you have a companion in your grave by what you have done,

And after death you have no alternative,
on the day men are called forth – so he accepts,

So if you were busy with anything – do not let it be,
that you are busy with anything other than makes Allāh pleased,

For mankind does not accompany anyone after his death,
or even before his death – except in his deeds,

Indeed a man is only a guest with his people,
he resides with them for a short time – and then leaves.”

1. In some transcripts it is al-ʿAlā’ bin Moḥammed bin al-Fadhl
2. According to certain transcripts it is made clear that the speaker of this particular line, and the poetry, is none other than al-Ṣalṣal bin al-Dalhamas, which is why at the end of this statement, before the poetry, he says “so I recited to Qays”.

حدثنا الحسن بن عبد الله بن سعيد العسكري، قال: حدثنا أبو بكر محمد بن الحسن بن دريد، قال: أخبرنا أبو حاتم، عن العتبي – يعني محمد بن عبيد الله – عن أبيه، قال: وأخبرنا عبد الله بن شبيب البصري، قال: حدثنا زكريا بن يحيى المنقري، قال: حدثنا العلاء بن الفضل ، عن أبيه، عن جده، قال: قال قيس بن عاصم: وفدت مع جماعة من بني تميم إلى النبي (صلى الله عليه وآله) فدخلت وعنده الصلصال بن الدلهمس ، فقلت: يا نبي الله، عظنا موعظة ننتفع بها، فإنا قوم نعمر في البرية. فقال رسول الله (صلى الله عليه وآله): (يا قيس، إن مع العز ذلا، وإن مع الحياة موتا، وإن مع الدنيا آخرة، وإن لكل شئ حسيبا، وعلى كل شئ رقيبا، وإن لكل حسنة ثوابا، ولكل سيئة عقابا، ولكل أجل كتابا، وإنه لا بد لك – يا قيس – من قرين يدفن معك وهو حي، وتدفن معه وأنت ميت، فإن كان كريما أكرمك، وإن كان لئيما أسلمك، ثم لا يحشر إلا معك، ولا تبعث إلا معه، ولا تسأل إلا عنه، فلا تجعله إلا صالحا، فإنه إن صلح أنست به، وإن فسد لا تستوحش إلا منه، وهو فعلك. فقال: يا نبي الله، أحب أن يكون هذا الكلام في أبيات من الشعر، نفخر به على من يلينا من العرب، وندخره. فأمر النبي (صلى الله عليه وآله) من يأتيه بحسان. قال: فأقبلت أفكر فيما أشبه هذه العظة من الشعر، فاستتب لي القول قبل مجئ حسان، فقلت: يا رسول الله، قد حضرتني أبيات أحسبها توافق ما تريد. فقلت لقيس :

تخير خليطا من فعالك إنما * * قرين الفتى في القبر ما كان يفعل
ولا بد بعد الموت من أن تعده * * ليوم ينادى المرء فيه فيقبل
فإن كنت مشغولا بشئ فلا تكن * * بغير الذي يرضى به الله تشغل
فلن يصحب الانسان من بعد موته * * ومن قبله إلا الذي كان يعمل
ألا إنما الانسان ضيف لأهله * * يقيم قليلا بينهم ثم يرحل