Rabbi Yochanan in the name of Rabbi Shimon ben Yochai says: "Ah, Lord GOD! Behold, You have made, etc. [nothing is too hard for You]" (Jeremiah 32:17). Rabbi Berechiah in the name of Rabbi Yitzchak said: "And you, Solomon my son, know the God of your father [and serve Him] with a whole heart and a willing soul, for the LORD searches all hearts and understands every imagination of the thoughts" (1 Chronicles 28:9). Before the thing formed has been formed, its thought is revealed before Him. Rabbi Yudan in the name of Rabbi Yitzchak: Before a thought has been formed in the heart of a person, it is revealed before You. Rabbi Yudan in the name of Rabbi Yirmeyah: "For there is not a word in my tongue, but lo, O LORD, You know it altogether" (Psalms 139:4). Before my tongue has taken possession of speech, lo, O LORD, You know it altogether. ("There is none holy as the LORD, for there is none beside You" — for there is no wearing-out of You.)
God Knows the Thought Before It Is Formed in Midrash Shmuel
Midrash Shmuel 5:5
רבי יוחנן בשם רבי שמעון בן יוחי אומר אהה ה' אלהים הנה אתה עשית וגו' [לא יפלא ממך כל דבר] (ירמי' ל"ב י"ז), רבי ברכיה בשם רבי יצחק אמר ואתה שלמה בני דע את אלהי אביך [ועבדהו] בלב שלם ובנפש חפצה כי כל לבבות דורש ה' וכל יצר מחשבות מבין (דה"א כ"ח ט'), קודם עד שלא נוצר יציר מחשבתו גלויה (לפניך) [לפניו]. רבי יודן בשם רבי יצחק קודם שלא נוצרה מחשבה בלבו של אדם גלויה לפניך, רבי יודן בשם רבי ירמיה כי אין מלה בלשוני הן ה' ידעתה כולה (תהלים קל"ט ד'), קודם שלא יירש לשוני דבור הן ה' ידעתה כולה, (אין קדוש כה' כי אין בלתך, כי אין בלותיך).