The Messenger of Allah ﷺ said, "The pen has been lifted from three: the sleeper until he wakes, the child until he comes of age, and the insane person until he regains his reason or recovers."
أن رسول الله ﷺ قال: رفع القلم عن ثلاثة: عن النائم حتى يستيقظ، وعن الصغير حتى يكبر، وعن المجنون حتى يعقل أو يفيق.
Abu Dawud (4398), Nasai (6/156), Ibn Majah (2041), Ibn Jarud (148), and Ahmad (24694) narrated it, and Ibn Hibban (142) and Hakim (2/59) graded it sahih, all of them through the hadith of Hammad bin Salama, from Hammad, from Ibrahim, from Aswad, from Ayesha, and he related it as mentioned.Hakim said, "It is sahih according to the standard of Muslim."I say, its chain is hasan because of Hammad, who is Ibn Abu Sulayman, for his hadith is hasan.It has also been narrated on the authority of Abu Hurairah, who said, the Messenger of Allah ﷺ said, "Every divorce is valid except the divorce of one who is insane and overcome in his mind." Tirmidhi (1191) narrated it and said, "We do not know this hadith as a raised narration except through the hadith of Atta bin Ajlan, and Atta bin Ajlan is daif, his narrations are worthless."I say, it is as he said, for this Atta bin Ajlan is al-Hanafi, Abu Muhammad al-Basri al-Attar, who is daif by the agreement of the scholars.The correct view in this matter is what has come from Ali bin Abu Talib as a stopped narration, worded, "Every divorce is valid except that of the insane." Bayhaqi (7/359) narrated it with a sahih chain going back to him.Tirmidhi said, "The practice among the scholars from the companions of the Prophet ﷺ and others is upon this, that the divorce of one who is insane and overcome in his mind is not valid, unless he is someone who is insane but has periods of lucidity, in which case he may divorce during his period of lucidity." End of quote.The remaining hadiths of this chapter are cited in the book on legal punishments.