The Messenger of Allah ﷺ saw me with lice falling onto my face and asked, "Are these vermin troubling you?"I said, "Yes."He then ordered me to shave my head. They were at Hudaybiyyah at the time, and it had not yet been made clear to them that they would have to shave there, as they were still hoping to enter Mecca. So Allah revealed the ruling concerning the ransom, and the Messenger of Allah ﷺ ordered me to feed six poor people with a faraq of food, or to fast three days, or to slaughter a sheep.
حدثنا عبد الرزاق حدثنا معمر عن ابن أبي نجيح عن مجاهد عن عبد الرحمن بن أبي ليلى
رآني رسول الله ﷺ وقملي يتساقط على وجهي فقال أتؤذيك هوامك هذه قال قلت نعم قال فأمرني أن أحلق وهم بالحديبية ولم يبين لهم أنهم يحلقون بها وهم على طمع أن يدخلوا مكة فأنزل الله الفدية فأمرني رسول الله ﷺ أن أطعم فرقا بين ستة مساكين أو أصوم ثلاثة أيام أو أذبح شاة
Its isnad is sahih. Ibn Abu Najeeh is Abdullah, and he is a well-known trustworthy narrator, but he practices tadlis and here he narrated using "an" (without specifying direct hearing). However, this does not harm the hadith because he is corroborated by another narrator. The hadith previously appeared at 18025.