Here is a Ṣaḥīḥ (Authentic) ḥadīth on the amount of knowledge Imām `Alī (عليه السلام) had of the Qur’ān. This ḥadīth is found in a much larger ḥadīth. Also this ḥadīth is not only found in Shī`ah books, but it is found all over the Sunnī books as well. I have posted another ḥadīth where Imām `Alī (عليه السلام) says, “Ask me whatever you wish” (Click here).
«ما في كتاب الله عز و جل آية إلا و أنا أعرف تفسيرها و في أي مكان نزلت من سهل أو جبل و في أي وقت نزلت من ليل أو نهار و أن هاهنا لعلما جما و أشار إلى صدره و لكن طلابه يسيرة و عن قليل يندمون لو قد يفقدوني»
Imām `Alī (عليه السلام) said: “There is not an ayah in the Book of Allāh (عَزَّ وَ جَلَّ) except that I know its tafsīr, and in whichever place it was revealed, on a plain or a mountain, and in whatever time it was revealed, in the night or the day.’ – Pointing to his chest – ‘here there is abundant knowledge, but the seekers of it are few, and from the few they will regret when they lose me.’
1. al-Sadūq, `Ilal al-Sharā`i’, ed. Muḥammad Ṣādiq Bahr al-`Ulūm, 1 vol. (Najaf, Maktabah al-Ḥaydariyyah, 1385), vol. 1, ch. 38, pg. 40