salaam alaykum I've heard some imams says that the shaytan knows what's in your heart/thoughts, yet I've heard that this isn't true and only Allah knows. Which is correct?

Ustadh AbdulAziz al-Haqqan
Imam Ibn Bāz said: “Every person has with him a shayṭān (devil) and an angel, just as the Prophet ﷺ said: ‘There is none among you except that he has a companion from the jinn and a companion from the angels.’ They said: ‘Even you, O Messenger of Allah?’ He said: ‘Even me, except that Allah helped me against him, so he submitted (embraced Islam), and he does not command me except with good.’ And the Prophet ﷺ informed us that the shayṭān whispers to a person, inciting him to evil, and that he has an influence (lammāh) upon his heart. By the decree of Allah, he is made aware of what the ʿabd intends of good or evil deeds. Similarly, the angel also has an influence upon the heart, inspiring him toward good and calling him to it. So these are things that Allah has enabled them to do — that is, He enabled both companions: the companion from the jinn and the companion from the angels.”