Rosh Chodesh is established in the Torah when God commands Moses to begin keeping a calendar
(א) וַיֹּ֤אמֶר יְהֹוָה֙ אֶל־מֹשֶׁ֣ה וְאֶֽל־אַהֲרֹ֔ן בְּאֶ֥רֶץ מִצְרַ֖יִם לֵאמֹֽר׃ (ב) הַחֹ֧דֶשׁ הַזֶּ֛ה לָכֶ֖ם רֹ֣אשׁ חֳדָשִׁ֑ים רִאשׁ֥וֹן הוּא֙ לָכֶ֔ם לְחׇדְשֵׁ֖י הַשָּׁנָֽה׃
(1) יהוה said to Moses and Aaron in the land of Egypt: (2) This month shall mark for you the beginning of the months; it shall be the first of the months of the year for you.
When the Temple stood, and even for a few centuries after it was destroyed, the practice was to establish the calendar based on public testimony of witnessing the new moon
(ז) אָב וּבְנוֹ שֶׁרָאוּ אֶת הַחֹדֶשׁ, יֵלְכוּ. לֹא שֶׁמִּצְטָרְפִין זֶה עִם זֶה, אֶלָּא שֶׁאִם יִפָּסֵל אֶחָד מֵהֶן, יִצְטָרֵף הַשֵּׁנִי עִם אַחֵר. רַבִּי שִׁמְעוֹן אוֹמֵר, אָב וּבְנוֹ וְכָל הַקְּרוֹבִין, כְּשֵׁרִין לְעֵדוּת הַחֹדֶשׁ. אָמַר רַבִּי יוֹסֵי, מַעֲשֶׂה בְטוֹבִיָּה הָרוֹפֵא, שֶׁרָאָה אֶת הַחֹדֶשׁ בִּירוּשָׁלַיִם, הוּא וּבְנוֹ וְעַבְדּוֹ מְשֻׁחְרָר, וְקִבְּלוּ הַכֹּהֲנִים אוֹתוֹ וְאֶת בְּנוֹ, וּפָסְלוּ אֶת עַבְדּוֹ. וּכְשֶׁבָּאוּ לִפְנֵי בֵית דִּין, קִבְּלוּ אוֹתוֹ וְאֶת עַבְדּוֹ, וּפָסְלוּ אֶת בְּנוֹ:
(7) If a father and his son saw the new moon, they should both go to the court in Jerusalem. It is not that they can join together to give testimony, for close relatives are disqualified from testifying together, but they both go so that if one of them is disqualified, the second may join together with another witness to testify about the new moon. Rabbi Shimon says: A father and his son and all their relatives are fit to combine together as witnesses for testimony to determine the start of the month. Rabbi Yosei said: There was an incident with Toviyya the doctor. When he saw the new moon in Jerusalem, he and his son and his freed slave all went to testify. The priests accepted him and his son as witnesses and disqualified his slave, for they ruled stringently that the month may be sanctified only on the basis of the testimony of those of Jewish lineage. And when they came before the court, they accepted him and his slave as witnesses and disqualified his son, due to the familial relationship.
In this legal work, 14th century Rabbi David Abudarham explains the concept of the birth of the new moon known as the Molad
(יא) וראש חדושה נקרא מולד הלבנה. וראוי היה להקרא חדוש הלבנה אלא שרז"ל קראו לו מולד מפני שבכל חדש הלבנה נסתרת בכמו שני ימים או פחות מעט קודם שתדבק בשמש ואחר כך מתחלת להתילד ולקנות אור ואין באורה כח להראות לבני העלם והיא כענין הילוד שאין בו כח לנהוג מנהג בני אדם וללכת ולנוע כשאר בעלי חיים.
(יב) וגדר המולד לדברי רז"ל הוא הרגע שהחמה והלבנה נדבקין בו יחד בחלק אחד מחלקי הרקיע במהלכם האמצעי והוא הנוהג על דרך אחד לעולם. והוא ראש לחדש הבא וסוף לחדש שעבר. וראוי היה לפי מהלך המאורות לשוותו ראש החדש לולי שאין שעת המולד גלויה לבני העולם ואין אדם מגיע אליה אלא מדרך חשבון וסברא ושניהם קשים על רוב העולם והספיקות באות מהן ואין מחשבות לב האדם באות בהן לדעת אחד ומפני זה לא החמיר הקב"ה ולא צונו לשמור ראשי החדשים משעת התחלתם ברקיע שהיא שעת המולד אבל הרחיב לנו הדבר הזה ונתן לנו רשות לקבוע החדש על עצת חכמים מפני שאין לנו אות שתהא מעידה לנו על התחלתו ברקיע והתחלתו למראית עינינו היא הגלויה לנו וההתחלה הזאת אינה שוה לעיני כל אדם ומפני זה היא צריכה לסיוע ולסיוג. והקב"ה נתן הרשות והכח בזה בידי חכמינו כדי לסייגו לדעתם ולחכמת' ולכן תלה הכתו' המועדים בקריאה ואמ' אלה מועדי יהוה אשר תקראו אותם מקראי קדש. להראות כי הרשות בידינו בקבוע המועדים.
(11) And the start of its renewal is called the birth of the moon. Yet it would have been fitting to call it the renewal of the moon. However the Sages, may their memory be blessed called it the birth, since every month the moon is hidden for about two days or a little less before it attaches itself to the sun, and it afterwards begins to be born and gather light. But its light does not [then] have the power to be seen by people. So that is like the matter of a newborn, since it does not have the power to act like the custom of [other] people, to walk and move like other animals.
(12) And according to the words of our Rabbis, may their memory be blessed, that is the moment that the sun and the moon attach themselves to each other in their median path in one of the parts of the sky; and this is the same in all of the world. So that is the beginning of the next month and the end of the past month. And it would have been fitting to designate this as the start of the month, according to the path of the luminaries, were it not that the [precise] time of this birth is not visible to people, such that the only way to arrive at is by way of calculation and reasoning. But both of these are difficult for most of the world and questions come about them, such that the thoughts of people do not come to a single opinion. And because of that, the Holy One, blessed be He, was not stringent and did not command us to observe the start of the months from their beginning in the sky, which is the time of the [moon's] birth. Rather, He granted us leeway about the thing and give us permission to set the month according to the counsel of the sages, since we have no sign that testifies to us about its beginning in the sky, whereas its beginning according to our eyesight - which is what is revealed to us - is not the same in every person's eyes. And because of that, it requires assistance and control. So the Holy One, blessed be He, gave the right and the power over this to the hands of our sages, so that they could control it according to their opinion and their wisdom. And that is why the verse made the festivals depend on proclamation, in its stating (Leviticus 23:4), "These are the festivals of the Lord, holy gatherings, which you shall proclaim in their seasons." That is to show that we have permission to set the festivals [by way of proclaiming the new months].
The Talmud discusses the tradition of blessing the New Moon
וא"ר אחא בר חנינא א"ר אסי א"ר יוחנן כל המברך על החדש בזמנו כאילו מקבל פני שכינה כתיב הכא (שמות יב, ב) החדש הזה וכתיב התם (שמות טו, ב) זה אלי ואנוהו תנא דבי רבי ישמעאל אילמלא (לא) זכו ישראל אלא להקביל פני אביהן שבשמים כל חדש וחדש דיים אמר אביי הלכך נימרינהו מעומד מרימר ומר זוטרא מכתפי (אהדדי) ומברכי א"ל רב אחא לרב אשי במערבא מברכי ברוך מחדש חדשים אמר ליה האי נשי דידן נמי מברכי אלא כדרב יהודה דאמר רב יהודה ברוך [וכו'] אשר במאמרו ברא שחקים וברוח פיו כל צבאם חוק וזמן נתן להם שלא ישנו את תפקידם ששים ושמחים לעשות רצון קונם פועלי אמת שפעולתן אמת וללבנה אמר שתתחדש עטרת תפארת לעמוסי בטן שהן עתידין להתחדש כמותה ולפאר ליוצרם על שם כבוד מלכותו ברוך אתה ה' מחדש חדשים
And Rabbi Aḥa bar Ḥanina says that Rabbi Asi says that Rabbi Yoḥanan says: With regard to anyone who blesses the new month in its proper time, it is as if he greets the Face of the Divine Presence. Alluding to this, it is written here concerning the sanctification of the new month: “This month shall be for you the beginning of months” (Exodus 12:2), and it is written there, where the Jewish people encountered the Divine Presence at the splitting of the sea: “This is my God and I will glorify Him” (Exodus 15:2). The term “this” is employed in both verses. The school of Rabbi Yishmael taught: If the Jewish people merited to greet the Face of their Father in Heaven only one time each and every month, it would suffice for them, since in the blessing of the moon there is an aspect of greeting the Divine Presence. Abaye said: Therefore, we will say the blessing while standing, in honor of the Divine Presence. The Gemara relates: Mareimar and Mar Zutra would lean on one another’s shoulders and recite the blessing. Rav Aḥa said to Rav Ashi: In the West, Eretz Yisrael, they recite the following blessing on the moon: Blessed is He Who renews the months. Rav Ashi said to him: Our women also recite that blessing, meaning that this is an abridged version for the unlettered. Rather, the full version of the blessing is the version of Rav Yehuda. As Rav Yehuda says: Blessed are You, Lord our God, King of the Universe, Who by His word created the heavens, and by the breath of his mouth all their hosts. He set for them a law and a time, that they should not deviate from their task. And they are joyous and glad to perform the will of their Owner; they are workers of truth whose work is truth. And to the moon He said that it should renew itself as a crown of beauty for those He carried from the womb, as they are destined to be renewed like it, and to praise their Creator for the name of His glorious kingdom. Blessed are You the Lord, Who renews the months.
This Midrash gives a parable to help explain the reason why Rosh Chodesh is symbolically important in Jewish practice
(ד) וְאֵת הַכּוֹכָבִים, אָמַר רַב אַחָא, מָשָׁל לְמֶלֶךְ שֶׁהָיוּ לוֹ שְׁנֵי אַפּוֹטְרוֹפִּין, אֶחָד שׁוֹלֵט בָּעִיר וְאֶחָד שׁוֹלֵט בַּמְדִינָה, אָמַר הַמֶּלֶךְ הוֹאִיל וּמִעֵט עַצְמוֹ זֶה לִהְיוֹת שׁוֹלֵט בָּעִיר, גּוֹזֵר אֲנִי עָלָיו בְּשָׁעָה שֶׁהוּא יוֹצֵא תְּהֵא כָּל אֻכְלוּסָא יוֹצְאָה עִמּוֹ, וּבְשָׁעָה שֶׁיְהֵא נִכְנָס תְּהֵא בּוּלֵי וְדִימוּס נִכְנְסָה עִמּוֹ. כָּךְ אָמַר הַקָּדוֹשׁ בָּרוּךְ הוּא הוֹאִיל וְהַלְּבָנָה הַזּוֹ מִעֲטָה עַצְמָהּ לִהְיוֹת שׁוֹלֶטֶת בַּלַּיְלָה, גּוֹזֵר אֲנִי עָלֶיהָ בְּשָׁעָה שֶׁהִיא יוֹצֵאת שֶׁיְהוּ הַכּוֹכָבִים יוֹצְאִין עִמָּהּ, בְּשָׁעָה שֶׁהִיא נִכְנֶסֶת יְהוּ הַכּוֹכָבִים נִכְנָסִים עִמָּהּ. וְדִכְוָותֵהּ (בראשית י, כה): וְשֵׁם אָחִיו יָקְטָן, אָמַר רַבִּי אַחָא לָמָּה נִקְרָא שְׁמוֹ יָקְטָן, שֶׁהָיָה מַקְטִין אֶת עֲסָקָיו, מַה זָּכָה, זָכָה לְהַעֲמִיד שְׁלשׁ עֶשְׂרֵה מִשְׁפָּחוֹת גְּדוֹלוֹת. וּמָה אִם יָקְטָן עַל יְדֵי שֶׁהָיָה מַקְטִין אֶת עֲסָקָיו כָּךְ, גָּדוֹל שֶׁהוּא מַקְטִין אֶת עֲסָקָיו עַל אַחַת כַּמָּה וְכַמָּה. וְדִכְוָתֵהּ (בראשית מח, יד): וַיִּשְׁלַח יִשְׂרָאֵל אֶת יְמִינוֹ וַיָּשֶׁת עַל רֹאשׁ אֶפְרַיִם וְהוּא הַצָּעִיר, אָמַר רַבִּי חוֹנְיָא וְכִי מִן הַתּוֹלְדוֹת אֵין אָנוּ יוֹדְעִים שֶׁהוּא הַצָּעִיר, אֶלָּא מַה הוּא הַצָּעִיר, שֶׁהָיָה מַצְעִיר אֶת עֲסָקָיו. מַה זָּכָה, זָכָה לִבְכוֹרָה. וּמָה אִם הַצָּעִיר עַל יְדֵי שֶׁהָיָה מַצְעִיר אֶת עֲסָקָיו, זָכָה לִבְכוֹרָה, הַגָּדוֹל שֶׁהוּא מַצְעִיר אֶת עֲסָקָיו, עַל אַחַת כַּמָּה וְכַמָּה, אֶתְמְהָא.
(4) “And the stars” (Genesis 1:16) – Rav Aḥa said: This is analogous to a king who had two stewards, one ruled [only] over the city and one ruled over the [rest of the] province. The king said: ‘Since this one diminished himself [and consented] to be ruler over the city, I decree concerning him that whenever he goes out, a large crowd should go out with him, and when he enters, the city council and the multitudes should enter with him.’ So, the Holy One blessed be He said: ‘Since the moon diminished itself to rule at night, I decree concerning it that when it goes out, the stars should go out with it, and when it goes in, the stars should go in with it.’ Similarly, “the name of his brother was Yoktan” (Genesis 10:25) – Rabbi Aḥa said: Why was he named Yoktan? It is because he would minimize [maktin] his affairs. What did he merit? He merited producing thirteen great families. Now, if Yoktan received this because he minimized his affairs, if an important man minimizes his affairs, all the more so. Similarly, “Israel extended his right hand, and laid it on the head of Ephraim, who was the younger” (Genesis 48:14) – Rabbi Ḥonya said: Do we not know from the accounts of the births that he was the younger? What, then, is “who was the younger [tza’ir]”? It is because he would minimize [matzir] his affairs. What did he merit? He merited the birthright. Now, if the young one merited the birthright because he minimized his affairs, an older person who minimizes his affairs, all the more so. This is astounding.
The blessing for reciting Kiddush Levanah according to the Chasidic liturgical custom
(ו) בָּרוּךְ אַתָּה יהוה אֱלֹהֵינוּ מֶלֶךְ הָעוֹלָם, אֲשֶׁר בְּמַאֲמָרוֹ בָּרָא שְׁחָקִים, וּבְרוּחַ פִּיו כָּל צְבָאָם, חֹק וּזְמַן נָתַן לָהֶם שֶׁלּא יְשַׁנּוּ אֶת תַּפְקִידָם, שָׂשִׂים וּשְׂמֵחִים לַעֲשׂוֹת רְצוֹן קוֹנָם, פּוֹעֵל אֱמֶת שֶׁפְּעֻלָּתוֹ אֱמֶת, וְלַלְּבָנָה אָמַר שֶׁתִּתְחַדֵּשׁ, עֲטֶרֶת תִּפְאֶרֶת לַעֲמוּסֵי בָטֶן שֶׁהֵם עֲתִידִים לְהִתְחַדֵּשׁ כְּמוֹתָהּ, וּלְפָאֵר לְיוֹצְרָם עַל שֵׁם כְּבוֹד מַלְכוּתו: בָּרוּךְ אַתָּה יהוה מְחַדֵּשׁ חֳדָשִׁים:
(6) Blessed are You, Lord, our God, King of the Universe, who with His utterance created the heavens, and with the breath of His mouth, all their host. Law and season did He give them, that they not deviate from their set function. They are glad and rejoice to do the will of their Creator — the Worker of truth whose work is true. The moon He directed to renew itself — a crown of glory to those who are borne from the womb, who are destined to be renewed just like it, and to glorify their Creator for the name of His glorious kingdom. Blessed are You, Lord, Renewer of the months.
A Talmudic tradition on the relationship between the moon and the Jewish people
תָּנוּ רַבָּנַן: בִּזְמַן שֶׁהַחַמָּה לוֹקָה — סִימָן רַע לַגּוֹיִם. לְבָנָה לוֹקָה — סִימָן רַע לְשׂוֹנְאֵיהֶם שֶׁל יִשְׂרָאֵל. מִפְּנֵי שֶׁיִּשְׂרָאֵל מוֹנִין לַלְּבָנָה, וְגוֹיִם לַחַמָּה. לוֹקָה בַּמִּזְרָח — סִימָן רַע לְיוֹשְׁבֵי מִזְרָח. בַּמַּעֲרָב — סִימָן רַע לְיוֹשְׁבֵי מַעֲרָב. בְּאֶמְצַע הָרָקִיעַ — סִימָן רַע לְכׇל הָעוֹלָם כּוּלּוֹ.
The Sages taught in another baraita: When the sun is eclipsed, it is a bad omen for the other nations. When the moon is eclipsed, it is a bad omen for the enemies of the Jewish people. This is due to the fact that the Jewish people calculate their calendar primarily based on the moon, and the other nations calculate based on the sun. When the sun is eclipsed in the east, it is a bad omen for the residents of the lands of the east. When it is eclipsed in the west, it is a bad omen for the residents of the lands of the west. When it is eclipsed in the middle of the sky, it is a bad omen for the entire world.
A midrashic explanation of the importance on the relationship between the Jewish people and the moon
(א) רבן גמליאל אומר, כמו ראשי חדשים מתחדשים ומתקדשים בעה"ז, כך יהיו ישראל מתחדשים ומתקדשים לעה"ב, שנ' דבר אל כל עדת בני ישראל ואמרת אליהם קדושים תהיו כי קדוש אני ה'. וחכמים אומרים, שמים וארץ עתידים לעבור ולחדש, מה כתי' עליהם ונגולו כספר השמים כאדם הקורא בתורה וגולל אותה וחוזר ופותח וגולל אותה, כך הב"ה עתיד לגול את השמים, שנ' ונגולו השמים כספר והארץ כבגד תבלה, כאדם שהוא פושט את טליתו ומקפל אותה וחוזר ופותח ולובש אותה ומחדש אותה במקומה, שנ' והארץ כבגד תבלה.
(1) THE NEW HEAVENS AND EARTH RABBAN GAMALIEL said: Just as the New Moons are renewed and sanctified in this world, so will Israel be sanctified and renewed in the future world just like the New Moons, as it is said, "Speak unto all the congregation of the children of Israel, and say unto them, Ye shall be holy: for I the Lord your God am holy" (Lev. 19:2). The sages say: The heavens and the earth are destined to pass away and to be renewed. What is written concerning them? "And all the host of the heaven shall be dissolved, and the heavens shall be rolled together as a scroll" (Isa. 34:4). Just as when a man reads in a scroll of the Torah and he rolls it, and again he opens it to read therein and he rolls it (together), likewise in the future will the Holy One, blessed be He, roll together the heavens like a scroll, as it is said, "And the heavens shall be rolled together as a scroll" (ibid.); "And the earth shall wax old like a garment" (Isa. 51:6); just as a man spreads out his garment and folds it up, and again he unfolds it || and puts it on and renews it (thereby), likewise the Holy One, blessed be He, in the future will fold up the earth and again will He spread it out and put it in its place like a garment, as it is said. "And the earth shall wax old like a garment" (ibid.).
One of the concepts that motivates the practice of BNirkat HaLevana in the Ashkenazi custom is the idea of pegimat halevanah, the diminishment of the moon - which provides lots of symbolism in Jewish literature around Rosh Chodesh
(טז) תָּנָא דְבֵי רַבִּי יִשְׁמָעֵאל אִלְמָלֵא לֹא זָכוּ יִשְׂרָאֵל אֶלָּא לְהַקְבִּיל פְּנֵי אֲבִיהֶם שֶׁבַּשָּׁמַֽיִם פַּֽעַם אַחַת בַּחֹֽדֶשׁ דַּיָּם אָמַר אַבַּיֵּי הִלְכָּךְ צָרִיךְ לְמֵימְרָא מְעֻמָּד: מִי זֹאת עוֹלָה מִן־הַמִּדְבָּר מִתְרַפֶּֽקֶת עַל־דּוֹדָהּ: וִיהִי רָצוֹן מִלְּפָנֶֽיךָ יְהֹוָה אֱלֹהַי וֵאלֹהֵי אֲבוֹתַי לְמַלֹּאת פְּגִימַת הַלְּבָנָה וְלֹא יִהְיֶה בָּהּ שׁוּם מִעוּט וִיְהִי אוֹר הַלְּבָנָה כְּאוֹר הַחַמָּה וּכְאוֹר שִׁבְעַת יְמֵי בְרֵאשִׁית כְּמוֹ שֶׁהָיְתָה קֹֽדֶם מִעוּטָהּ שֶׁנֶּאֱמַר אֶת־שְׁנֵי הַמְּאֹרוֹת הַגְּדֹלִים וְיִתְקַיֵּם בָּֽנוּ מִקְרָא שֶׁכָּתוּב וּבִקְשׁוּ אֶת־יְהֹוָה אֱלֹהֵיהֶם וְאֵת דָּוִיד מַלְכָּם אָמֵן:
(16) It was taught in the school of Rabbi Yishmael: Even if Israel was privileged only to greet their Father in heaven, once a month, it would be sufficient for them. Abbaye said: “Therefore it must be recited standing.” Who is this coming up from the wilderness clinging to her beloved? May it be Your will, Adonoy, our God, and God of our fathers, to fill the deficiency of the moon, so that it will no longer be diminished; and may the light of the moon be like the light of the sun, —and like the light of the seven days of creation— as it was before it was diminished, as it is said: “The two great luminaries.” And may there be fulfilled for us the Scriptural verse which says: “They will seek Adonoy, their God, and David, their king. Amein.
There is a well standing tradition that Rosh Chodesh is a time of special significance for women as explained in this modern halakhic text
(ג) אמנם בזמן שהיו מקריבים את קרבן המוסף במקדש, היו גם גברים שנהגו להימנע מעשיית מלאכות גדולות בראש חודש, אלא שאין למנהגם תוקף, מפני שחטאו בחטא העגל. אבל נשים שלא חטאו שייכות יותר לקדושת ראש חודש, ויש תוקף למנהגן.
(ד) לפיכך, צריכה כל אשה למנוע את עצמה מקצת מלאכות בראש חודש, למשל, תקפיד שלא לסרוג בו, כדי שיהיה לה היכר בין יום רגיל לראש חודש. ובוודאי שלא תתכנן לעצמה עבודות גדולות בראש חודש.
(ה) והמהדרות נוהגות להימנע מהמלאכות שאסורות בחול המועד, ובכלל זה אינן תופרות וסורגות ומתקנות דברים בבית. אבל לבשל, לאפות ולגהץ, מותר כמו בחול המועד. לכבס במכונה מותר, מפני שאין בזה כמעט טרחה. ואם הכיבוס נועד לצורך לבישת בגדים בראש חודש עצמו, אף לכבס ביד מותר. מלאכה שאשה עושה לצורך פרנסתה מותרת אף למנהג המהדרות, מפני שאם תיעדר מעבודתה באופן קבוע בראש חודש, תאבד את פרנסתה. ואף כשאין חשש שיפטרוה, אם הכסף נחוץ לה או שייגרם למקום עבודתה נזק אם לא תבוא, מותר לה לעבוד.
(3) In truth, in the time of the Temple, when the Kohanim (priests) brought musaf offerings, some men also would refrain from doing major work on Rosh Ḥodesh. But their practice is no longer binding, because they participated in the sin of the Golden Calf. Women, on the other hand, did not sin, and thus have more of a connection to the sanctity of Rosh Ḥodesh. As a result, their practice remains valid.
(4) Therefore, every woman should refrain from doing certain types of work on Rosh Ḥodesh – knitting, for example – in order to differentiate between Rosh Ḥodesh and ordinary days. It goes without saying that she should not plan to do any big jobs on Rosh Ḥodesh.
(5) Some women go above and beyond and refrain from doing any type of work that is forbidden on Ḥol Ha-mo’ed. This includes sewing, knitting, and fixing things in the house. Cooking, baking, and ironing, however, are permitted, as they are permitted on Ḥol Ha-mo’ed as well. Washing clothing in a washing machine is also permitted, because it entails almost no effort. If the clothes are needed for Rosh Ḥodesh itself, one may wash them even by hand. An employed woman may work on Rosh Ḥodesh, even if she generally follows the practice of those who go above and beyond, because if she misses work regularly on Rosh Ḥodesh, she might lose her job. And even if there is no concern that she will be fired, she may go to work if she needs the money or if her absence will cause her employer to lose money.
Jewish tradition holds a connection between King David and Rosh Chodesh because of this verse found in the book of I Samuel
(ה) וַיֹּ֨אמֶר דָּוִ֜ד אֶל־יְהוֹנָתָ֗ן הִֽנֵּה־חֹ֙דֶשׁ֙ מָחָ֔ר וְאָנֹכִ֛י יָשֹׁב־אֵשֵׁ֥ב עִם־הַמֶּ֖לֶךְ לֶאֱכ֑וֹל וְשִׁלַּחְתַּ֙נִי֙ וְנִסְתַּרְתִּ֣י בַשָּׂדֶ֔ה עַ֖ד הָעֶ֥רֶב הַשְּׁלִשִֽׁית׃
(5) David said to Jonathan, “Tomorrow is the new moon, and I am to sit with the king at the meal. Instead, let me go and I will hide in the countryside until the third evening.
Reb Levi Yitzchak of Berditchev discusses the relationship in Chasidic thought between King David and Rosh Chodesh
(קמט) מה שאומרים בשמונה עשרה של ראש חודש ובשירי דוד עבדך. הכלל, כי יום טוב של פסח ושבועות וסכות הם כנגד האבות אברהם יצחק יעקב, וראש חודש הוא בחינת דוד ולכך אנו אומרים בשמונה עשרה של ראש חודש ובשירי דוד עבדך. וזהו שכתוב בכתבי האר"י ז"ל וכסא דוד עבדך מהרה לתוכה תכין, על משיח בן יוסף. הכלל, כי לכל דבר צריך הכנה ולזה רמזו רבותינו ז"ל (שבת קיח:) אלמלא שמרו ישראל שתי שבתות, כי לכל דבר הצריך הכנה אזי צריכין הכנה מאתו דבר עצמו. וזהו אלמלא שמרו ישראל שתי שבתות, דהיינו השבת הראשון יהיה הכנה על שבת השני ולכך יבוא משיח בן יוסף תחילה, כי על ידו יהיה הכנה למשיח בן דוד, כי מאותו דבר עצמו צריך הכנה לאותו דבר שמכין עצמו לזה. וזה הרמז וכסא דוד עבדך מהרה לתוכה תכין שכתוב בהאר"י ז"ל, שמרומז על משיח בן יוסף שלא יהרג. תכין, מרומז שהוא יהיה הכנה למשיח בן דוד, דהיינו שההכנה לא יהיה בטל:
(149) Regarding that which we say, “and in the songs of David, Your servant,” in the Shmoneh Esreh (standing prayer) of Rosh Chodesh – the general principle is that the holidays of Pesach, Shavuot and Sukkot correspond to the forefathers, Avraham, Yitzchak and Yaakov, whereas Rosh Chodesh is the aspect of David. That is why we say, “and in the songs of David, Your servant,” in the Shmoneh Esreh (standing prayer) of Rosh Chodesh. And this is [the meaning of] that which is written in the writings of the Ari, may his memory be blessed: “And establish the throne of David, Your servant, quickly within it,” is about the Messiah, son of Yosef (the precursor of the main Messiah, son of David). And the general principle [here] is that everything needs preparation; and our Rabbis, may their memory be blessed, hinted to this (Shabbat 118b), “Were the Jewish people to observe two Shabbats.” That is because everything that requires preparation requires preparation with that same thing itself. And that is [the meaning of], “Were the Jewish people to observe two Shabbats.” That is, the first Shabbat would be preparation of the second Shabbat. And that is why the Messiah, son of Yosef must come first; for through him is there preparation for the Messiah, son of David. This is since the preparation for the thing that requires preparation must be from that thing itself. And this is the hint, “and establish the throne of David, Your servant, quickly within it,” which is written in the writings of the Ari, may his memory be blessed. It is hinting to the Messiah, son of Yosef, that he will not be killed. “Establish,” that he be the preparation for the Messiah, son of David. That is to say, that the preparation should not be eliminated.
