Amina Inloes, Amina Inloes is originally from the US and has a PhD in Islamic Studies from the University of Exeter on Shi'a hadith. She is the program leader for the MA Islamic Studies program at the... Answered 2 months ago

According to Twelver Shi'i narrations, the knowledge of the Imams is received through divine sources. It is available throughout their lives but culminates to a new level after the departure of the previous Imam (or, in the case of Imam Ali, the Prophet). They have access to anything they need or want to know. This knowledge is available to them at any time; however, at certain times, certain specific information is presented to them (such as the deeds of their followers).

It is considered to be a step lower than the type of wahy given to the messengers. For instance, some narrations say that the Imams can hear the angel Jibra'il but not see him. Similarly, the Imams provide guidance, but not a revealed scripture like the Qur'an which is a Book in the word of Allah.

The mechanics of how this knowledge is acquired in mentioned in some narrations, although these narrations tend to be somewhat obscure and may or may not be accurate. In any case, it is said that the Imams have access to something resembling a column of light or a lamp between themselves and Allah through which they can attain knowledge of anything or to see any place. In other places, it is simply said that the Imams were created with certain types of knowledge, such as knowledge of the explanation of the Qur'an and other fundamentals regarding the nature of this world and the worlds before and afterwards. There are also some texts the Imams possessed such as Mushaf Fatima and Kitab Ali, although it is not said that they required these texts to know what was in them.

Insofar as knowledge is potentially infinite, all of these things could be accepted altogether without contradiction .

In any case, this is a large and complex subject, so to learn more about it, one could read hadith collections such as Basa'ir al-Darajat and al-Kafi.