With regard to the previously cited ḥadith: “…and he forbade that poetry be recited in it,” and in another wording: “…and that people rehearse poetry therein.”
This report is transmitted by ʿAmr ibn Shuʿayb, from his father, from his grandfather; its documentation was mentioned a short while ago. The alternate wording is related by al-Tirmidhī, al-Nasāʾī, and al-Bayhaqī.
The ḥadith is further supported by a corroborating narration from Ḥakīm ibn Ḥizām, who said:
“The Messenger of Allah ﷺ forbade that retaliation (qiṣāṣ) be carried out in the mosque, that legal punishments be executed there, or that poetry be recited in it.”
Al-Dāraqutnī recorded this report.
The explanation of tanāshud (rehearsing poetry) given above is, in my view, the best interpretation offered. I have taken it from the notes of the scholar Aḥmad Muḥammad Shākir on al-Tirmidhī. By adopting this interpretation one can reconcile the present ḥadith with those that indicate the permissibility of reciting poetry in the mosques, as will be discussed under “Permitted Matters,” no. 11.
Scholars have differed on the issue: some forbid it absolutely, while others allow it unconditionally. Al-Qurṭubī said in his Tafsīr:
“The sounder view is to differentiate. One must look at the poetry itself: if it contains praise of Allah, or of His Messenger ﷺ, or defense of them—as in the poetry of Ḥassān—or it urges goodness, admonition, renunciation of the world, and moderation in it, then such poetry is commendable, whether in mosques or elsewhere.” He added: