Thus, Allah’s saying, “in the mosques,” employs the definite article in a general sense. If i'tikaf were not valid except in the three mosques, the definite article here would necessarily refer to a specific, mentally understood set; but where is the evidence for that? If there is no proof that the definite article refers to such a specific set, then it conveys generality. This is the basic principle.
Moreover, how could this ruling be addressed in Allah’s Book to the entire Ummah, from the east of the earth to its west, and then we say that it is valid only in the three mosques? It is far-fetched that a ruling should be stated generally for the Muslim Ummah, only for us then to say that this act of worship is valid solely in the three mosques—just as tawaf is valid only in al-Masjid al-Haram.
The correct view, then, is that it applies generally to every mosque. Yet there is no doubt that i'tikaf in the three mosques is superior, just as prayer in the three mosques is superior.
His statement, “recommended,” is established by the Quran, the sunnah, and scholarly consensus.
As for the Quran, Allah said to Abraham: “Purify My House for those who circumambulate it, those who devote themselves to worship there, and those who bow and prostrate.” [al-Baqarah: 125] From this verse, we know that i'tikaf was legislated even among the previous nations. Allah also said: “And do not have relations with them while you are in retreat in the mosques.” [al-Baqarah: 187]
As for the sunnah, it is clear, well known, and mass-transmitted in meaning that the Messenger of Allah ﷺ observed i'tikaf, as did his Companions along with him (1), and that his wives observed i'tikaf after his death (2).