The spirit of man is the lamp of the Lord...

(כז) נֵ֣ר יי נִשְׁמַ֣ת אָדָ֑ם

חֹ֝פֵ֗שׂ כָּל־חַדְרֵי־בָֽטֶן׃

(27) The lamp of the Lord is the lifebreath/spirit of man

Searching/revealing all the inmost parts.

(2) כך פתח ר' תנחומא בר ר' נר אלקים נשמת אדם חופש כל חדרי בטן (משלי כ' כ"ז)

א"ר אחא כשם (שמלכי) [שלמלכי] בו"ד יש קיריוסים הם מודיעים למלך כל דבר ודבר כך יש לפני הקב"ה קיריוסים ומגידים כל דבר ודבר שאדם עושה במטמוניות בחשך בגלוי ואלו הן

הקיריוסין של הקדוש ברוך הוא זו הנפש שמגדת למלאך ומלאך לכרוב והכרוב להקב"ה

מניין שכן הוא שלמה אומר עוף השמים יוליך את הקול ובעל כנפים יגיד דבר (קהלת י' כ') ודיפתראות כתובות לפני הקדוש ברוך הוא [על] כל מה שבני אדם עושין ולעתיד לבא המקום מוכיח לכל אחד ואחד מעשיו והם עומדים תמיהים

לאחד שהיה נשוי בתו של מלך והוא משכים ושואל שלומו של מלך בכל יום והמלך אומר לו כך וכך עשית בביתך כך וכך כעסת כך הכית עבדיך כך כל דבר ודבר

והיה יוצא ואומר לבני פלטין מי אמר שכך עשיתי מניין הוא יודע אמרו לו שוטה את בתו אתה נשוי ואתה אומר מניין הוא יודע בתו היא מגדת לו

כך האדם הזה עושה כל מה שמבקש ונפשו מגדת הכל להקדוש ברוך הוא והקב"ה דן את האדם ואומר לו כך וכך עשית והוא עומד ותמיה ואומר מי הודיעו שעשיתי כל אילו

והם משיבין אותו ואומרים לו שוטה שבעולם בתו את נשוי ורוחו עליך שנאמר ויפח באפיו נשמת חיים (בראשית ב' ז') ואתה אומר מניין הוא יודע מה שאתה חושב בלבך נפשך מגדת לו כל הדברים

נר אלקים נשמת אדם חופש כל חדרי בטן מחפש כל מה שבמטמניות ומגדת להקדוש ברוך הוא

אמר דוד אזכרה נגינתי בלילה עם לבבי אשיחה ויחפש רוחי (תהלים ע"ז ז') עם לבבי אני אשיח ורוחי ומגיד להגיד להקב"ה ויחפש רוחי נר אלקים נשמת אדם חופש כל חדרי בטן

לכך והיה בעת ההיא אחפש ירושלים בנרות:

Rabbi Tanhuma Berrabi began his discourse: The spirit of man is the lamp of the Lord, searching all the inward parts.(Proverbs 20:27)

Citing Rav Acha: As with kings of flesh-and-blood come agents who inform the king of each and every matter, so similarly there are before the Holy One agents who report on everything that a person does in secret, in the dark, or openly. And these are them:

The informants of the Holy One is the soul which tells to the angel, the angel tells it to the cherub and the cherub to the Holy One.

How do we know this? From Solomon who said For a bird of the air may carry the utterance, And a winged creature may report the word. (Ecclesiastes 10:20). And records are put in writing for the Holy One regarding everything which people do. And in the future the Holy One will reprove each person for their deeds and they will stand in astonishment.

A parable: there was a man who was married to the daughter of a king. Early in the morning he would get up and greet the king. And each day the king would say “You did this and this in your home. You got angry about this thing. This is how you struck your servant.” And similarly for everything!

So the man would come out and ask the people of the palace “Who told him that I did that? how does he know?” They would reply “You are a fool! You are married to his daughter and you ask ‘how does he know?’?” Why his daughter tells him!!

Although a person does whatever they want, their soul tells the Holy One every single thing. Then, when the Holy One passes judgement upon the person and says “you did this and this” the person is astonished and asks “who reported that I did all of this?”

So they tell them again and again: “You are the biggest fool in the world! You are married to His daughter - and He breathed life into you - for it says and He breathed into him the spirit of life (Genesis 2:7) and you ask ‘How does He know what you are thinking in your heart?’ Why, your soul tells Him everything!”

The spirit of man is the lamp of the Lord, searching all the inward parts. It searches out what is hidden in all his innermost chambers and reports to the Holy One.

King David said I recall at night their jibes at me; I commune with myself; my spirit inquires. (Psalms 77:7) Whatever I communicate to my heart, my spirit makes diligent search and reports to the Holy One. And my spirit is able to make such diligent search because The spirit of man is the lamp of the Lord, searching all the inward parts.

All the above [R. Tanhuma concluded], is implied in the words And it shall come to pass at that time that I will search Jerusalem with lamps. (Zephania 1:12).