Yes. Some hadith were written down in the lifetime of the Prophet (saw), although most were transmitted orally and written collections became common in the generations after him.
- The evidence includes the written sheet of Ali (ra) (Sahih al-Bukhari), the permission given to Abu Shah to write down a sermon (Sahih al-Bukhari and Sahih Muslim), the notebook of Abdullah ibn Amr ibn al-As (ra) called al-Sadiqa (Musnad Ahmad), and the letters and treaties dictated by the Prophet (saw).
- A hadith in Sahih Muslim reports that the Prophet (saw) said, 'Do not write from me anything except the Qur'an', and scholars reconcile it with the permissions in several ways, mainly by saying that the ban was early or was meant to prevent confusion with the Qur'an.
- The sheet of Hammam ibn Munabbih, a student of Abu Hurayra (ra), survives in manuscript and is found almost word for word in the later collections, which supports the accuracy of the later books.
- Writing and memorising worked together: the Arabs were a people of strong memory, and the systematic collections followed from about the end of the first century of the Hijra.
Introduction
The question asks whether the hadith were written in the time of the Prophet (saw). It matters because a common claim, made by some orientalists and by others, is that the hadith were passed on by word of mouth for two centuries and written down only in the age of al-Bukhari and Muslim, which would leave room for invention. Muslim scholars answer that this picture is not accurate. This answer sets out the evidence for early writing, the hadith that seem to forbid it, how scholars reconcile them, and what the surviving early documents show.
A good answer should begin by saying plainly that much of the hadith was carried in memory in the first generation, and that the Companions were taught to value memory. The point is that writing was also present from the start.
Hadith written in the lifetime of the Prophet (saw)
Several reports in the most authentic books show this. Ali ibn Abi Talib (ra) said, 'We have nothing except the Book of Allah and this sheet,' in which were the rules on blood-money, the freeing of captives and the sanctity of Madinah (Sahih al-Bukhari, Book of Knowledge; Sahih Muslim). Abu Hurayra (ra) said that no one had more hadith than he, 'except Abdullah ibn Amr, for he wrote and I did not' (Sahih al-Bukhari, Book of Knowledge). After the conquest of Makkah the Prophet (saw) gave a sermon, and a man from Yemen, Abu Shah, asked that it be written for him, and the Prophet (saw) said, 'Write it for Abu Shah' (Sahih al-Bukhari and Sahih Muslim). The Prophet (saw) is also said to have dictated letters to rulers and tribes, and the document often called the Constitution of Madinah is preserved in the biography of Ibn Ishaq as reported by Ibn Hisham.
Abdullah ibn Amr (ra) said that he used to write everything he heard from the Prophet (saw), and some Quraysh told him not to, as the Prophet (saw) was a human being who spoke in anger and in pleasure. He mentioned it to the Prophet (saw), who pointed to his mouth and said, 'Write, for by the One in whose hand is my soul, nothing comes out of it but truth' (Sunan Abi Dawud, Book of Knowledge, graded sahih by al-Albani). His collection, known as al-Sahifa al-Sadiqa, is said to have contained about a thousand hadith, and its content is preserved in the Musnad of Ahmad ibn Hanbal through his grandson 'Amr ibn Shu'ayb.
The hadith that seems to forbid writing
Abu Sa'id al-Khudri (ra) reported that the Prophet (saw) said, 'Do not write anything from me, and whoever wrote anything from me other than the Qur'an, let him erase it' (Sahih Muslim, Book of Zuhd). Scholars have given several explanations. Al-Nawawi, Ibn Hajar and al-Khattabi mention that the ban was early, when the Qur'an was being revealed and the Companions might confuse the two, and that the permission came later, so that it abrogated the ban. A second view, attributed to Ibn Qutayba, is that the ban was to avoid writing hadith in the same sheet as the Qur'an. A third view, given by some scholars, is that the ban was for those who could rely on memory, and the permission for those who could not. Al-Bukhari is reported to have judged this narration to be the statement of Abu Sa'id himself and not of the Prophet (saw), though Muslim records it as the Prophet's. The several explanations lead to one result: the hadith do not show that writing was forbidden for ever, since the practice of the Companions and the later consensus are clear.
The generation after the Companions
Several of the Companions' students wrote hadith that they received. Hammam ibn Munabbih (d. around 130 AH) wrote down what he heard from Abu Hurayra (ra) in a sheet, al-Sahifa al-Sahiha, with about 138 hadith. It was found in manuscripts in Damascus and Berlin and was published by Muhammad Hamidullah in the twentieth century. The scholar Muhammad Mustafa al-A'zami compared it with the hadith of Abu Hurayra in the Musnad of Ahmad and the Sahih of al-Bukhari, and found that they match, which indicates that the later books copied the early text faithfully. Others wrote too: Sa'd ibn 'Ubada al-Ansari, Jabir ibn Abdullah, Anas ibn Malik and Ibn Abbas (ra) are named as having written or having had books, according to the biographers, such as Ibn Sa'd and the author of Taqyid al-'Ilm, al-Khatib al-Baghdadi.
The Umayyad caliph Umar ibn Abd al-Aziz (d. 101 AH) wrote to the governor of Madinah, Abu Bakr ibn Hazm, to collect the hadith, saying that he feared the loss of knowledge and the passing of the scholars (Sahih al-Bukhari mentions the statement in the Book of Knowledge as a chapter heading). The scholar Ibn Shihab al-Zuhri (d. 124 AH) then made a systematic collection. Malik's Muwatta' was written in the following generation, and the collections of Ahmad, al-Bukhari and Muslim after that.
What critics say and the replies
Some Western scholars, such as Ignaz Goldziher in the nineteenth century and Joseph Schacht in the twentieth, argued that the hadith were largely produced after the Prophet (saw) and projected back to him. Others, including Nabia Abbott and Fuat Sezgin, have argued from papyri and early documents that written transmission was present from the first century. Muslim scholars such as al-A'zami, in Studies in Early Hadith Literature, point to the sheets above, and also to the system of chains of narration (isnad) and the science of criticism of the narrators (jarh wa ta'dil), by which scholars checked reports. Scholars differ about how far the early books were fully written, and about how to date particular reports, so that it is more careful to say that both oral and written means were used together.
Conclusion
Hadith were written in the lifetime of the Prophet (saw), in the sheets of some Companions and in letters and treaties, even though the age relied heavily on memory. The report that forbids writing is explained by the scholars as early or as limited, and the written sheets that survive agree with the later collections. Allah knows best.
References
Sahih al-Bukhari, Book of Knowledge; Sahih Muslim, Book of Zuhd and Hajj; Sunan Abi Dawud, Book of Knowledge; Musnad Ahmad
Ibn Hajar al-'Asqalani, Fath al-Bari; al-Nawawi, Sharh Sahih Muslim; al-Khatib al-Baghdadi, Taqyid al-'Ilm; Ibn Sa'd, al-Tabaqat al-Kubra
Muhammad Mustafa al-A'zami, Studies in Early Hadith Literature; Muhammad Hamidullah (ed.), Sahifat Hammam ibn Munabbih; Nabia Abbott, Studies in Arabic Literary Papyri II