The halachic system, like all legal systems, is on based on verifiable actions. What one may think when signing a contract is of little bearing; “matters of the heart are not matters” (Kiddushin 49b). While there are instances where our thoughts create moral obligations[1], it is rare that such can create a change in legal status. Rare--but not unheard of.
The central aspect of the sukkah is its s'chach, the shoddy and leaky roof that is open to the heavens above. This roof must be made of natural materials that were grown in the ground, which by definition cannot be susceptible to the laws of purity and impurity. The laws of purity--which are of significance only vis a vis our relation to the Temple[2]--apply only to food, drink, and vessels[3]. The s'chach must come from “p'solet goren veyekev, the leftovers (i.e., that which we would throw out) of the threshing floor and winepress". While pieces of wood are ideal for s'chach, if those pieces of wood are fashioned into a spoon, they would be a vessel and no longer valid as s'chach.
The convergence of one’s thought and the laws of sukkah can be seen in the Talmudic discussion regarding one who cuts a branch off a tree that has some food on it. In order for the branch to be used ass'chach, the stalks must be of greater volume than the food. If the food portion--which is susceptible to tumah--is the majority, it may not be used for s'chach. In the course of discussing whether the stems should be included in calculating the volume of the portion attributable to the food, the Gemara (Sukkah 13b -14a) explains that it all depends on one’s intent. If the branch was cut for use as s'chach, all would agree one need only worry about having the quantity of stems and stalks total up to a greater quantity than the food itself. But if one cuts the branch for the purposes of eating, then the stems would be included as part of the food. This is so because one would want the food to stay attached to the stem to help ensure the food does not go to waste.
If one cuts the branch with the initial intent to use it for food, but changes one's mind and decides to use it for s'chach instead, we have a Talmudic debate whether such change of intent is effective; i.e., would the stems count as food susceptible to the laws of impurity, thereby invalidating the s'chach, or as leftovers whose lack of importance leaves them free of any possibility of impurity?
What is clear from the above is that in reference to the laws of purity and impurity, what we think matters. This actually is consistent with the primary area where matters of the mind (and heart) matter most--sacrifices in the Temple. Here, one wrong thought can render a sacrifice pigul, with all those who eat of such liable to the punishment of karet, excision.
In regards to our interaction with our fellow man, our thoughts matter little. They are unknown and unknowable. It is how we act that matters[4]. Yet in regard to our relationship with G-d, who knows what fills our mind and hearts, what we think reflects our true self. We may act in a particular way for all kinds of reasons, but only G-d knows how sincere our actions really are[5].
In the course of its discussion of the use of stalks, the Gemara notes that they can serve as an atar, a pitchfork. Atar, the Gemara notes, is the word used by the Torah, Vayeatar Yizchak lenochach ishto, (Breisheet 25:21) to describe the prayer of Yitzchak on behalf of his barren wife Rivka. The Gemara thus asks, “Why is the prayer of the righteous likened to a pitchfork? To teach us that just as the pitchfork turns the corn from place to place in the barn, so the prayers of the righteous turn the mind of the Holy One, blessed be He, from the attribute of harshness to that of mercy” (Sukkah 14a).
Prayer is defined as “worship of the heart”. Yet not only can our heart lead us to greater heights, it can lead G-d to greater action. And with regard to G-d, thoughts and action are one and the same.
[1] The best example is that of charity, where our mental resolve to donate creates an obligation to do so. This rabbinic law is based on the Biblical charge that kol nediv libo, all whose hearts desire [to do so] should contribute to the Mishkan. See below for the link between thought and the Temple.
[2] The only exception I know of is that one must tovel in a mikvah only those utensils which can theoretically become tameh, i.e., only something that is considered a vessel.
[3] The longest of the 63 tractates of the Mishnah is Masechet Kelim, vessels, whose thirty chapters go into almost excruciating detail after detail describing what exactly qualifies as a vessel and what does not.
[4] The Sefer HaChinuch, which so clearly and succinctly summarizes the 613 mitzvoth, has as its central thesis that actions mold character and hence, our way of thinking. By carrying out acts of kindness to others, we develop a love for that person; or, to put it another way, it's not that we are kind to those we like, but rather that we like those to whom we are kind.
[5] It is apparent that the Torah wants to link the Sukkah with the Temple and laws of impurity. The holiday of Sukkot has more sacrifices than any other, and it is no surprise the Temple was dedicated on Sukkot. We have previously discussed how we derive the height of the sukkah from that of the aron, and Sukkot is known as z'man simchateinu, with the highest form of happiness achieved when we feel the presence of G-d in the Temple.