The ancient rabbis grappled with this too. And they found a beautiful answer in a seemingly simple verse from Job: “Who preceded Me, that I should repay?” (Job 41:3). This verse, explored in Midrash Tehillim, a collection of rabbinic interpretations on the Book of Psalms, opens a window into a profound understanding of divine reward.

It's all about intention.

The midrash on Psalm 30, “A Psalm, a Song of Dedication of the House, for David,” (Shir HaMaalot Chanukat HaBayit in Hebrew) uses this verse from Job to ask a powerful question: Who thought in their heart to do a mitzvah – a good deed or commandment – before God, that God did not reward them for it? It's not just about the act itself, but the thought behind it.

The Midrash Tehillim continues with a series of vivid examples. Who made tzitzit (the ritual fringes on a garment) and didn’t receive their reward even before the garment was finished? Who built a fence for their roof, fulfilling the commandment to protect others from harm, and didn’t receive their reward before the house was even complete? Who gave tzedakah (charity) and didn’t receive their reward before the coins even left their hand?

The message is clear: God anticipates our good intentions and rewards them accordingly. The very act of intending to do good sets the wheels of divine reward in motion.

And here’s the really part: the midrash says that even if you only think about doing a mitzvah, and for whatever reason don’t actually do it, God credits you as if you did perform it!

This brings us back to David, the shepherd-king. David yearned to build the Beit HaMikdash, the Holy Temple in Jerusalem. He envisioned it, planned it, poured his heart into the idea. But ultimately, he wasn’t the one chosen to build it. His son, Solomon, would have that honor.

Yet, the psalm dedicating the Temple is attributed to David: “A Psalm, a Song of Dedication of the House, for David.” Why? Because, according to the midrash, his intention, his heartfelt desire to build the Temple, was so powerful that it was as if he had built it himself.

So, what does this all mean for us? Maybe it's this: our intentions matter. The spark of goodness within us, the desire to make the world a better place, is seen and valued, even if we can't always bring those intentions to fruition. It's a comforting thought, isn't it? That the universe recognizes and rewards the good we aspire to do, even before we do it.