Siman 418
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א רֹאשׁ חֹדֶשׁ אָסוּר בְּתַעֲנִית.
1 The law of fasting on the beginning of the month. Containing five sections. On the beginning of the month it is forbidden to fast.
ב אֵין גּוֹזְרִין תַּעֲנִית עַל הַצִּבּוּר בְּרָאשֵׁי חֳדָשִׁים, חֲנֻכָּה וּפוּרִים. וְאִם הִתְחִילוּ, שֶׁגָּזְרוּ לְהִתְעַנּוֹת כָּךְ וְכָךְ יָמִים וְהִתְחִילוּ בָּהֶם קֹדֶם רֹאשׁ חֹדֶשׁ אֲפִלּוּ יוֹם אֶחָד, אֵין מַפְסִיקִין, וּמִתְעַנִּין וּמַשְׁלִימִין.
2 Fasts are not decreed for the congregation to occur on the beginning of the month, on Chanukah, or on Purim. If they began, i.e. they declared a fast of a specified number of days, beginning from before the beginning of the month, then even on the first of the month they shall not disrupt [the fast. Instead] they shall fast and remedy it.
ג יָחִיד שֶׁקִּבֵּל עָלָיו תַּעֲנִית כָּךְ וְכָךְ יָמִים וּפָגַע בּוֹ רֹאשׁ חֹדֶשׁ, אוֹ שֶׁקִּבֵּל עָלָיו לְהִתְעַנּוֹת בְּרֹאשׁ חֹדֶשׁ, אִם קִבְּלוֹ בִּלְשׁוֹן קַבָּלַת תַּעֲנִית בְּעָלְמָא אֵינוֹ צָרִיךְ הַתָּרָה. וְאִם קִבְּלוֹ עָלָיו בִּלְשׁוֹן: הֲרֵי עָלַי, שֶׁהוּא לְשׁוֹן נֶדֶר, צָרִיךְ הַתָּרַת חָכָם. וְעַיֵּן בְּיוֹרֵה דֵּעָה סִימָן רט"ו (ס"ג).
3 An individual who commits himself to a fast of a specified number of days, and the beginning of the month interrupts, or if he commits himself to fast on the beginning of the month: If he committed himself using common language of accepting fast, he does not require formal release from his vow (and his pledge is automatically abrogated). But if he committed himself with the phrasing "I hereby accept upon myself," i.e. the language used for an oath, he needs to be released from his vow by a sage. See Yoreh De'ah, Chapter 216 section 3.
ד אִם נִשְׁבַּע לְהִתְעַנּוֹת כָּךְ וְכָךְ יָמִים וְאֵרַע בָּהֶם רֹאשׁ חֹדֶשׁ, הַשְּׁבוּעָה חָלָה עָלָיו מִטַּעַם אִסוּר כּוֹלֵל. וְאִם נִשְׁבַּע בְּפֵרוּשׁ לְהִתְעַנּוֹת בְּרֹאשׁ חֹדֶשׁ, נ"ל שֶׁחָלָה עָלָיו שְׁבוּעָה כֵּיוָן שֶׁאֵינוֹ אֶלָּא מִדְּרַבָּנָן. אֶלָּא שֶׁמִּדִּבְרֵי הָרַמְבָּ"ם נִרְאֶה לִכְאוֹרָה שֶׁהוּא מִדְּאוֹרַיְתָא (וְע"ל סי' תק"ע.
4 If he swore to fast a specified number of days and the beginning of the month happened to be included among them, the oath is binding upon him because of the general prohibition. However, if he explicitly swore to fast on the beginning of the month, it appears to me that the oath is binding on him because the [prohibition] has only a rabbinical source. Yet from the words of Rambam, it appears that the source is biblical. See earlier, chapter 570.
ה הַמִּתְעַנֶּה בְּרֹאשׁ חֹדֶשׁ אוֹ בַּחֲנֻכָּה וּפוּרִים תַּעֲנִית חֲלוֹם, צָרִיךְ לְמֵיתַב תַּעֲנִיתָא לְתַעֲנִיתֵיהּ.
5 One who fasts for a dream on the beginning of the month, on Chanukah, or on Purim, must add a [second] fast onto his fast.