The custom of eating carob on Tu B'shvat, the New Year for Trees, is not cited in the Talmud or in the Code of Jewish Law, yet it is common in many communities. Our sages teach that the customs of the Jewish people are also Torah and have profound reasons congruent with Torah teachings and laws.

As it turns out, eating carob has an intrinsic connection both to Tu B'Shevat and to customs in general. But first, a word about the halachic significance of Tu B'Shevat, and what makes it the New Year for Trees:

Let's say you are a farmer in the Land of Israel and you have an orchard. Once a year, you must give a certain amount of fruit as tithes—for the Kohanim, for the poor, or for eating in Jerusalem (depending on the year in a seven-year cycle). The question arises: When is the cut-off date that divides between one year's crop and the next? The answer is fairly simple: It is the day when most of the rainy season in the Land of Israel has passed. That is the 15th day of Shevat, known commonly as Tu B'Shevat ("Tu" is one way of saying fifteen).

Now another problem arises: There are certain trees—such as the carob tree—that can begin to bud before Tu B'Shevat, but will not be harvested until much later, well after Tu B'Shevat. Would their tithing follow the rules of the tree-year in which they bud, or the tree-year in which they are harvested? This question is addressed in the Talmud:

The rabbis taught: A tree whose fruits were in bud before the fifteenth of Shevat must be tithed as the produce of the past year, but if they bud after that, they are tithed during the coming year. Said Rabbi Nechemia: This applies to trees whose fruit ripen and are harvested over an extended period of time. But in the case of a tree whose crop is harvested all at once—such as the date-palm, olive tree, or carob tree—although their fruits may begun to bud before the fifteenth of Shevat, they are tithed with the produce of the coming year.

The Talmud concludes that "The custom of the masses follows Rabbi Nechemia with regard to carobs." This law was decided not by a vote of the sages, but simply by the custom of the Jewish people.

Throughout this entire discussion there is only one law that is decided by the custom of the people—the custom regarding carob trees. Now isn't that neat: In order to commemorate Tu B'Shevat, the custom evolved that we should do something to note a custom mentioned in the Talmud—at least in an indirect way—by eating carobs!

Another unique thing about the carob tree is that the Talmud tells us that it takes 70 years to mature and bear fruit. By eating carob on Tu B'Shevat, we are also highlighting an important lesson to be learned from the carob tree: the importance of patiently investing in the future even when it is a long and arduous process with no immediate gains, for the fruits of our labors will be harvested by generations to come.1

Carobs are also special in that they were the food of Rabbi Chanina ben Dosa, who famously subsisted an entire week on a single kav of carobs. The Talmud describes Rabbi Chanina as one who was accustomed to miracles.2 Thus, eating carobs serves to evoke his memory and express our hope for miracles from G‑d.3

Let me know if this helps.

Best regards,

Rabbi Baruch S. Davidson

Sources
Tractate Rosh Hashana 15b, Kuntres Tu B'Shevat by Rabbi David Cohen ("The Nazir of Jerusalem") – Jerusalem 1973.