Praise be to Allaah.
It was narrated from Abu Sa’eed al-Khudri that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Do not write anything from me; whoever has written anything from me other than the Qur’aan, let him erase it and narrate from me, for there is nothing wrong with that.” (Narrated by Muslim, al-Zuhd wa’l-Raqaa’iq, 5326)
Al-Nawawi said in his commentary on Saheeh Muslim:
“Al-Qaadi said: there were many disputes among the Sahaabah and Taabi’een concerning the writing down of knowledge. Many of them regarded this as being makrooh, but most of them regarded it as permissible. This dispute is no longer an issue.
They differed as to the meaning of this hadeeth which says that it is forbidden. It was said that this pertained to one who was sure of his memory, and there was the fear that he may rely upon what he had written if he wrote it down; the ahaadeeth which say that it is permissible to write things down is to be interpreted as referring to the one whose memory is not reliable, such as the hadeeth, “Write it down for Abu Shaah”; or the hadeeth of the saheefah of ‘Ali (may Allaah be pleased with him); the hadeeth of the book of ‘Amr ibn Hazm, which contains laws on inheritance, sunnahs and diyaat (blood money); the hadeeth about writing down charity, and the minimum amounts at which zakaah becomes obligatory (nisaab), with which Abu Bakr sent Anas (may Allaah be pleased with him) to Bahrain; the hadeeth of Abu Hurayrah which says that Ibn ‘Amr ibn al-‘Aas used to ; write things down but he (Abu Hurayrah) did not write things down, and other ahaadeeth. And it was said that the hadeeth forbidding writing down ahaadeeth was abrogated by these ahaadeeth. The prohibition was in effect when there was the fear that (the words of the Prophet (peace and blessings of Allaah be upon him) might be mixed with the Qur’aan. When that danger was no longer present, permission was given to write down (ahaadeeth). And it was said that the prohibition mentioned in the hadeeth referred to writing ahaadeeth on the same page as Qur’aan, lest they become mixed and thus the reader would be confused when looking at this page. And Allaah knows best.
The hadeeth of Abu Shaah was narrated by al-Bukhaari from Abu Hurayrah (may Allaah be pleased with him), who said: ‘When Allaah granted His Prophet (peace and blessings of Allaah be upon him) victory over Makkah, he stood before the people and praised and glorified Allaah, then he said: “Allaah protected Makkah from the elephant and has given authority to His Messenger and the believers over it, so fighting was forbidden for anyone before me, and was made permissible for me for part of a day, and it will not be permissible for anyone after me. Its game should not be chased, its thorny bushes should not be uprooted, and picking up its fallen things is not allowed except for one who makes public announcement for it, and he whose relative is murdered has the option either to accept a compensation for it or to retaliate.” Al-‘Abbas said, “Except Al-Idhkhir (a kind of plant), for we use it in our graves and houses.” The Messenger of Allaah (peace and blessings of Allaah be upon him) said, “Except Al-Idhkhir.” Abu Shaah, a Yemeni, stood up and said, “O Messenger of Allaah! Get it written for me.” The Messenger of Allaah (peace and blessings of Allaah be upon him) said, “Write it for Abu Shaah.” (al-Luqatah, 2254)
Ibn Hajar said: What may be understood from the story of Abu Shaah (“Write it for Abu Shaah”) is that the Prophet (peace and blessings of Allaah be upon him) gave permission for hadeeth to be written down from him.
This contradicts the hadeeth of Abu Sa’eed al-Khudri, which says that the Messenger of Allaah (peace and blessings of Allaah be upon him) said, ‘Do not write down anything from me except the Qur’aan.’ (Narrated by Muslim).
The two may be reconciled by noting that the prohibition applied only to the time when the Qur’aan was being revealed, lest it be confused with something else, and that permission was given at other times; or that the prohibition applied only to writing down things other than Qur’aan with the Qur’aan on one thing, and that permission was given to write them separately; of that the prohibition came first and the permission abrogated that, when there was no longer any fear of confusion. This is most likely to be the case.
It was said that the prohibition applied only to those whom it was feared would depend on the writing and not memorize things, and that permission was given for those from whom such a thing was not feared.
The scholars said: a group of the Sahaabah and Taabi’een regarded it as makrooh to write down the hadeeth and they regarded it as mustahabb to learn it from them by heart, as they had learned it. But when people were no longer able to strive so hard (in memorizing) and the scholars feared that knowledge might be lost, they compiled it in books.”