Usul al-Kafi
Book 4:
The Book of Divine Proof

Chapter 33
Inheritors of the knowledge of the Prophets

365. 3. Imam Jafar as-Sadiq (p): Prophet Dawood (David) (p) inherited the knowledge of the prophets (who preceded him), Prophet Sulayman (Solomon) (p) inherited (the knowledge of) Prophet Dawood (p) and Prophet Muhammad (p) inherited (the knowledge of) Prophet Sulayman (p) and we are the inheritors of the knowledge of Prophet Muhammad (p), and indeed with us is the knowledge of the Book of Prophet Ibrahim (Abraham) (p) and the Tablets of Prophet Musa (Moses) (p). The knowledge that only increases day and night, day by day and hour by hour.

366. 7. Imam Musa al-Kazim (p) was asked by a narrator: Is the Prophet Muhammad (p) the inheritor of the knowledge of all the Prophets.
The Imam (p): Yes.
The Narrator: From Prophet Adam (p) to the Prophet Muhammad (p) himself?
The Imam (p): Whosoever was sent as prophet by God, Prophet Muhammad (p) was more knowledgeable than him.
The Imam (p) continued: Verily God says in his Noble Quran: If there was a Quran by which the mountains were made to move, or the earth split asunder, or the dead made to speak thereby… (Q, 13:31) and surely we have inherited that Noble Quran which causes the mountains to move, and the cities to cleave asunder, and the dead to come back to life. We know (the place of) the water beneath the air. Indeed, in the Noble Quran there are verses according to which nothing can happen without God’s permission, just as what was permitted by God written in the previous books. God has entered this for us in the Book of the Books (Ummul Kitab). Verily, God has said: And nothing is hidden in the heaven and earth, but it is in a Manifest Book (Ummul Kitab) (Q, 27:75).
Then, the Imam (p) quoted the verse: Then We gave the Book to those of our servants as We have chosen … (Q, 35:32). And we are those whom God has chosen, and to whom He has given this, in which is the meaning of everything.