The earliest hadith were written down during the Prophet's own lifetime by some Companions, such as Abd Allah ibn Amr ibn al-As (al-Sahifa al-Sadiqa) and Ali (ra), and by the time of the successors the writing of hadith was widespread. Large compilation by the state began under Umar ibn Abd al-Aziz (r. 99 to 101 AH), and the great collections followed in the second and third centuries.
- In the Prophet's lifetime: the sheet of Abd Allah ibn Amr, Ali's document, and the writing for Abu Shah.
- After him: the sheet of Hammam ibn Munabbih, written from Abu Hurayra, survives in manuscript.
- State compilation: Umar ibn Abd al-Aziz ordered scholars to record hadith, according to al-Bukhari.
- Debate: some Western scholars said hadith were written late; manuscript and chain studies by Muslim and Western scholars challenge this.
Introduction
The question of when hadith were first recorded matters because critics have claimed that hadith were only collected 200 years after the Prophet (saw). The sources show a different picture, with writing and oral transmission in parallel from the first generation. This answer sets out the main evidence, the hadith on the prohibition of writing and how scholars reconcile them, and the modern debate.
Writing in the Prophet's lifetime
The Qur'an itself was written down under the Prophet's supervision, and the Prophet (saw) had scribes. As for hadith, Abu Hurayra (ra) said that no one among the Companions had more hadith than he, except Abd Allah ibn Amr (ra), because Abd Allah used to write and he did not (Sahih al-Bukhari 113). Abd Allah ibn Amr called his collection al-Sahifa al-Sadiqa, 'the truthful sheet', and he said he asked the Prophet (saw) for permission to write what he heard, and the Prophet (saw) allowed it (Sunan Abi Dawud 3646; graded sahih by many). This sheet is said to have contained around a thousand reports and was preserved by his family, and later reports from it are found in the Musnad of Ahmad.
Ali (ra) said that he had nothing written from the Prophet (saw) except the Qur'an and what is in this sheet, which contained rules on the blood-money, the freeing of captives and that a Muslim is not killed for a disbeliever (Sahih al-Bukhari 111). After the conquest of Makkah, the Prophet (saw) ordered that a sermon be written down for a man from Yemen called Abu Shah (Sahih al-Bukhari 2434, Sahih Muslim 1355).
The report about not writing
A report in Muslim states that the Prophet (saw) said: 'Do not write anything from me except the Qur'an, and whoever has written something from me other than the Qur'an, let him erase it' (Sahih Muslim 3004). Scholars gave several answers. One answer is that the prohibition was early, for fear that the Qur'an would be mixed with other writing, and was later abrogated by permission. Another is that the prohibition applied to writing the Qur'an and hadith on the same page, and a third that it was for those who could not be trusted to write accurately. Some scholars, such as al-Bukhari, held that the report is a statement of Abu Sa'id al-Khudri rather than of the Prophet (saw), though others disagreed.
Writing by the Companions and successors
A number of Companions, such as Anas ibn Malik, Jabir ibn Abd Allah and Sa'd ibn Ubada, are reported to have written reports. Among the successors, Sa'id ibn Jubayr and others wrote, and Hammam ibn Munabbih (d. around 130 AH) recorded about 138 reports from Abu Hurayra (ra) in a sheet known as al-Sahifa al-Sahiha. Manuscripts of this sheet were found in libraries in Damascus and Berlin, and it was edited in the twentieth century, notably by Muhammad Hamidullah, who published an edition in the 1950s and 1960s. The reports in it correspond closely with those in later collections, which is cited as evidence of the accuracy of transmission. I give these details from general recollection.
Compilation under Umar ibn Abd al-Aziz
Al-Bukhari reports in the chapter on knowledge in his Sahih that Umar ibn Abd al-Aziz wrote to Abu Bakr ibn Hazm, the governor of Madinah, to look for what exists of the hadith of the Prophet (saw) and write it down, since he feared the loss of knowledge and the death of the scholars. Ibn Shihab al-Zuhri (d. 124 AH) is named among those who compiled for the caliph. The statement is in al-Bukhari without a full chain, and the scholars have discussed the details, but it is widely cited as showing official support for writing. From this period, the books of the scholars of Madinah, Makkah, Basra, Kufa and Syria appeared, leading to the Muwatta and the Musannafs and then to the Musnads and the Sahihs.
The modern debate
Ignaz Goldziher in the late nineteenth century and Joseph Schacht in 1950 argued that most hadith were produced in the second and third centuries, not in the first. Muslim scholars such as Mustafa al-A'zami in Studies in Early Hadith Literature (1968), and Western scholars including Nabia Abbott, Fuat Sezgin and Harald Motzki, used manuscripts, papyri and chain analysis to argue for earlier writing. A reader who wants to explore it should start with al-A'zami's book and Motzki's articles.
Why the question matters
For the believer, the key point is that the Companions and the successors cared about preserving the Prophet's words, and that the combination of memory, writing and chain criticism made a sound transmission possible. The Prophet (saw) said that a person who conveys what he heard as he heard it may be better than the one who heard it (Jami' al-Tirmidhi 2657; hasan sahih), which was a source of motivation.
A timeline in brief
In outline, the sequence is as follows. In the Prophet's lifetime, several Companions wrote reports for themselves, with his permission. In the first century after the Hijra, the successors compiled sheets and notebooks, and the practice grew. Around 100 AH, the caliph Umar ibn Abd al-Aziz encouraged official compilation. In the second century, the Muwatta and the early Musannafs were written. In the third century, the Musnads and the Sahihs and Sunans were compiled. Each stage built on the one before, and the chains of transmission link them. This is a simplified account, and specialists give more detailed schemes with disputed dates.
Written documents in the Prophet's time
Alongside the private sheets, the Prophet (saw) used writing in the affairs of the community. He sent letters to rulers and tribes, and the treaty of al-Hudaybiyyah was written down (Sahih al-Bukhari, Book of Conditions). The agreement known as the Document of Madinah is preserved in the early biography of Ibn Ishaq as transmitted by Ibn Hisham. These records show that writing was familiar to the first community and that the question was not whether the Companions could write but what should be written.
The early books on the question
The debate about writing hadith was itself recorded by early scholars. Al-Khatib al-Baghdadi (d. 463 AH) wrote Taqyid al-'Ilm, a book that gathers the reports for and against writing, and Ibn Abd al-Barr gave a chapter to the subject in Jami' Bayan al-'Ilm wa Fadlihi. They report that some Companions and Successors disliked the writing of anything beside the Qur'an for fear that it would distract from it, and that others wrote freely. Umar ibn al-Khattab (ra) is reported to have considered writing down the Sunnah and then decided against it, for fear that people would turn to it and neglect the Book of Allah.
The picture that emerges is of a community that took care over both memory and writing. By the end of the first century the objection had largely faded, and by the time of al-Zuhri the writing of hadith was the usual practice.
Conclusion
Hadith were written from the Prophet's lifetime, in the sheets of Abd Allah ibn Amr and Ali, and the practice continued among the Companions and successors, with state-sponsored compilation under Umar ibn Abd al-Aziz. The great collections arose from this tradition. The debate with those who date hadith writing late is ongoing, with strong evidence against late dating.
References
Sahih al-Bukhari 111, 113, 2434; Sahih Muslim 1355, 3004
Sunan Abi Dawud 3646; Jami' al-Tirmidhi 2657, 3599
Mustafa al-A'zami, Studies in Early Hadith Literature (1968)
Muhammad Hamidullah (ed.), Sahifat Hammam ibn Munabbih
Nabia Abbott, Studies in Arabic Literary Papyri II (Chicago, 1967)
Harald Motzki, The Origins of Islamic Jurisprudence (Brill, 2002)
al-Khatib al-Baghdadi, Taqyid al-'Ilm; Ibn Abd al-Barr, Jami' Bayan al-'Ilm wa Fadlihi