Halacha

הלכה א
שְׁבִיתָה בַּשְּׁבִיעִי מִמְּלָאכָה מִצְוַת עֲשֵׂה שֶׁנֶּאֱמַר (שמות לד כא) "וּבַיּוֹם הַשְּׁבִיעִי תִּשְׁבֹּת". וְכָל הָעוֹשֶׂה בּוֹ מְלָאכָה בִּטֵּל מִצְוַת עֲשֵׂה וְעָבַר עַל לֹא תַּעֲשֶׂה שֶׁנֶּאֱמַר (דברים ה יד) "לֹא תַעֲשֶׂה כָל מְלָאכָה". וּמַה הוּא חַיָּב עַל עֲשִׂיַּת מְלָאכָה. אִם עָשָׂה בִּרְצוֹנוֹ בְּזָדוֹן חַיָּב כָּרֵת. וְאִם הָיוּ שָׁם עֵדִים וְהַתְרָאָה נִסְקָל. וְאִם עָשָׂה בִּשְׁגָגָה חַיָּב קָרְבַּן חַטָּאת קְבוּעָה:
כסף משנה
1.
Resting from labor1Within the context of the Sabbath laws, labor does not refer to strenuous work, but rather to the performance of one of the thirty nine labors that were necessary for the construction of the Temple or a labor which is analogous to them. (See Chapter 7, Halachah 1.)
The Rambam's choice of wording in this halachah is significant. Our Rabbis have offered two definitions of the mitzvah of resting on the Sabbath: In his commentary on Yevamot 6a, the Rashba states that the mitzvah is negative in nature: one refrains from performing prohibited labors. In contrast, in his commentary on Leviticus 23:24, the Ramban explains that the mitzvah possesses a positive dimension: to spend the day in a restful frame of mind, abstaining from all activities - even those that are not forbidden labors - which would disrupt this tranquility.
From the Rambam's choice of wording in this halachah, it would appear that he follows the first view. From his statements in Chapter 21, Halachah 1, however, it would appear that he accepts the second perspective. (See also Tzafenat Paneach.)
on the seventh day fulfills a positive commandment,2Sefer HaMitzvot (Positive Commandment 154) and Sefer HaChinuch (Mitzvah 85) consider this to be one of the 613 mitzvot of the Torah. as [Exodus 23:12] states, "And you shall rest on the seventh day."3In Sefer HaMitzvot (General Principle 9), the Rambam mentions that the commandment to rest on the Sabbath is mentioned 12 times in the Torah. Sefer HaKovetz and others question why the Rambam cites this proof-text in particular. Anyone who performs a labor on this day negates the observance of a positive commandment and also transgresses a negative commandment,4Many of the mitzvot involve a positive and a negative commandment which share a single objective. for [ibid. 20:10] states, "Do not perform any labor [on5 Sefer HaMitzvot (Negative Commandment 320) and Sefer HaChinuch (Mitzvah 32) consider this to be one of the 613 mitzvot of the Torah. it]."
What are the liabilities incurred by a person who performs labor [on this day]? If he does so willingly,6i.e., without being forced by others as a conscious act of defiance,7and not inadvertently.
The Radbaz (Vol. V, Responsum 1510) notes that the Rambam uses the expression "willingly, as a conscious act of defiance" with regard to the transgressions of idolatry (Hilchot Avodat Kochavim 3:1), the Sabbath laws, and the laws of Yom Kippur (Hilchot Sh'vitat Asor 1:1). With regard to all other transgressions punishable by כרת, the Rambam merely states "as a conscious act of defiance."
The Radbaz explains that it is possible that the Rambam mentioned the concept of "willingly" with regard to these three transgressions because they are the first cases of כרת mentioned in the Mishneh Torah. After mentioning the concept on these three occasions, he does not think further repetition is necessary.
he is liable for karet;8כרת means "cut off." Mo'ed Katan 28a relates that a person liable for כרת would die prematurely, before reaching the age of fifty. The Rambam (Hilchot Teshuvah 8:1) emphasizes that being "cut off in this world" is not the sum total of Divine retribution for such a transgression. In addition, the person's soul is also cut off and prevented from reaching the world to come. if witnesses who administer a warning are present,9As explained in Hilchot Sanhedrin 12:1-2, punishment is not administered for the violation of a transgression unless the transgressor is made aware of the punishment he could receive for his deed. he should be stoned [to death].10See Numbers 15:35. This is the most severe form of execution. If he performs [labor] without being conscious of the transgression,11accidentally, performing a forbidden labor or doing so without awareness of the transgression involved he is liable to bring a sin offering of a fixed nature.12The Rambam uses this term to differentiate the sin offering required from a קרבן עולה ויורד - a guilt offering - which differs depending on the financial status of the person bringing it. See Hilchot Shegagot 1:4.

הלכה ב
כָּל מָקוֹם שֶׁנֶּאֱמַר בְּהִלְכוֹת שַׁבָּת שֶׁהָעוֹשֶׂה דָּבָר זֶה חַיָּב הֲרֵי זֶה חַיָּב כָּרֵת. וְאִם הָיוּ שָׁם עֵדִים וְהַתְרָאָה חַיָּב סְקִילָה. וְאִם הָיָה שׁוֹגֵג חַיָּב חַטָּאת:
כסף משנה
2.
Whenever the expression, "one who performs this is liable" is used within the context of the Sabbath laws, the intent is that he is liable for karet, and if witnesses are present and administer a warning, he is liable to be stoned to death. If he performs such an activity without being aware of the transgression, he is liable for a sin offering.1The Rambam is explaining that by performing a forbidden act on the Sabbath, a person incurs liability. The nature of this liability depends on his intent and on whether witnesses are present. These factors are common, however, to all the laws of the Sabbath. Therefore, in the future, all that is necessary to say is that "the person is liable," and based on the principles stated here, we can determine what his liability is.

הלכה ג
וְכָל מָקוֹם שֶׁנֶּאֱמַר שֶׁהָעוֹשֶׂה דָּבָר זֶה פָּטוּר הֲרֵי זֶה פָּטוּר מִן הַכָּרֵת וּמִן הַסְּקִילָה וּמִן הַקָּרְבָּן אֲבָל אָסוּר לַעֲשׂוֹת אוֹתוֹ דָּבָר בְּשַׁבָּת וְאִסּוּרוֹ מִדִּבְרֵי סוֹפְרִים וְהוּא הַרְחָקָה מִן הַמְּלָאכָה. וְהָעוֹשֶׂה אוֹתוֹ בְּזָדוֹן מַכִּין אוֹתוֹ מַכַּת מַרְדּוּת. וְכֵן כָּל מָקוֹם שֶׁנֶּאֱמַר אֵין עוֹשִׂין כָּךְ וְכָךְ אוֹ אָסוּר לַעֲשׂוֹת כָּךְ וְכָךְ בְּשַׁבָּת הָעוֹשֶׂה אוֹתוֹ דָּבָר בְּזָדוֹן מַכִּין אוֹתוֹ מַכַּת מַרְדּוּת:
כסף משנה
3.
Whenever the expression, "one who performs this is not liable" is used, the intent is that he is not liable for karet, for [execution by] stoning, or for bringing a [sin] offering. It is, however, forbidden to perform this act on the Sabbath.2Shabbat 3a makes a similar statement of principle, but states that there are three exceptions to this rule. When discussing these exceptions, the Rambam deviates from the terminology used in the Talmud and states that these three acts are "permitted."
In such an instance, the prohibition is Rabbinic3Our translation reflects the usual interpretation of the Hebrew expression מדברי סופרים. There are commentaries (e.g., the gloss of the Kessef Mishneh to Hilchot Ishut 2:1) who cite the Rambam's statements in Sefer HaMitzvot (General Principle 2) and explain that this expression can refer to a prohibition of the Torah which is derived through the accepted traditions of Biblical exegesis. In this instance, however, the Rambam's intent is clear; the term refers to prohibitions that the Rabbis instituted on their own initiative as safeguards. in origin and was instituted as a safeguard against [the performance of] labor. A person who performs such an act is given "stripes for defiance."4The Rambam discusses this punishment in Hilchot Edut 18:6, explaining that the person is flogged to the extent of the court's discretion (in contrast to the number of lashes received for the violation of a Torah command, which is fixed at 39). Other authorities offer different interpretations.Similarly, whenever the expressions "this should not be performed..." or "it is forbidden to do this on the Sabbath" are used, a person who performs such an act as a conscious act of rebellion5Shoshanat Ha'amakim states that this expression implies that a person must be given a warning before such a punishment is administered. is given "stripes for defiance."

הלכה ד
וְכָל מָקוֹם שֶׁנֶּאֱמַר מֻתָּר לַעֲשׂוֹת כָּךְ וְכָךְ הֲרֵי זֶה מֻתָּר לְכַתְּחִלָּה. וְכֵן כָּל מָקוֹם שֶׁנֶּאֱמַר אֵינוֹ חַיָּב כְּלוּם אוֹ פָּטוּר מִכְּלוּם אֵין מַכִּין אוֹתוֹ כְּלָל:
כסף משנה
4.
Whenever the expression, "it is permissible to do this" is used, the intent is that, at the outset, one may perform this act.6I.e., there is no prohibition whatsoever for performing the act in question. Similarly, whenever the expressions, "one is under no obligation" or "one is not liable at all" are used, one does not receive any punishment at all [for performing such an act.]7This expression implies that, at the outset, it is improper to perform such an act. Nevertheless, doing so does not warrant punishment (Maggid Mishneh, Kessef Mishneh).

הלכה ה
דְּבָרִים הַמֻּתָּרִים לַעֲשׂוֹתָן בְּשַׁבָּת וּבִשְׁעַת עֲשִׂיָּתָן אֶפְשָׁר שֶׁתֵּעָשֶׂה בִּגְלָלָן מְלָאכָה וְאֶפְשָׁר שֶׁלֹּא תֵּעָשֶׂה. אִם לֹא נִתְכַּוֵּן לְאוֹתָהּ מְלָאכָה הֲרֵי זֶה מֻתָּר. כֵּיצַד. גּוֹרֵר אָדָם מִטָּה וְכִסֵּא וְסַפְסָל וְכַיּוֹצֵא בָּהֶן בְּשַׁבָּת וּבִלְבַד שֶׁלֹּא יִתְכַּוֵּן לַחְפֹּר חָרִיץ בַּקַּרְקַע בִּשְׁעַת גְּרִירָתָן. וּלְפִיכָךְ אִם חָפְרוּ הַקַּרְקַע אֵינוֹ חוֹשֵׁשׁ בְּכָךְ לְפִי שֶׁלֹּא נִתְכַּוֵּן. וְכֵן מְהַלֵּךְ אָדָם עַל גַּבֵּי עֲשָׂבִים בְּשַׁבָּת וּבִלְבַד שֶׁלֹּא יִתְכַּוֵּן לַעֲקֹר אוֹתָן. לְפִיכָךְ אִם נֶעֶקְרוּ אֵינוֹ חוֹשֵׁשׁ. וְרוֹחֵץ יָדָיו בַּעֲפַר הַפֵּרוֹת וְכַיּוֹצֵא בּוֹ וּבִלְבַד שֶׁלֹּא יִתְכַּוֵּן לְהַשִּׁיר הַשֵּׂעָר. לְפִיכָךְ אִם נָשַׁר אֵינוֹ חוֹשֵׁשׁ. וְכֵן פִּרְצָה דְּחוּקָה מֻתָּר לְהִכָּנֵס בָּהּ בְּשַׁבָּת אַף עַל פִּי שֶׁמַּשִּׁיר צְרוֹרוֹת. וְכֵן כָּל דָּבָר שֶׁאֵין מִתְכַּוֵּן כְּגוֹן זֶה הֲרֵי זֶה מֻתָּר:
כסף משנה
5.
It is permissible to perform an act that is permitted on the Sabbath, despite the fact that it is possible - but it is not an absolute certainty8If, however, it is certain that the forbidden labor will be performed, it is prohibited to perform the permitted act, as explained in the following halachah. - that, [as a result of one's actions], a forbidden labor9Rabbenu Avraham, the Rambam's son (Birkat Avraham 9), explains that by using the term "forbidden labor" in this and the following halachah, the Rambam implies that there is a difficulty only if a prohibition from the Torah is involved. If merely a Rabbinic prohibition is concerned, it is permitted without question. This question is also discussed by the Mishneh L'Melech. will be performed, provided one does not have the intent to perform that labor.10The Rambam's decision is the subject of a difference of opinion between Rabbi Yehudah and Rabbi Shimon bar Yochai. (See Beitzah 23b and other sources.) Rabbi Shimon maintains that although a forbidden labor results from a person's activity, since he did not desire that this labor be performed, he is not held liable. Rabbi Yehudah, in contrast, holds the person liable, for his actions brought about the performance of a forbidden labor.
The commentaries explain Rabbi Shimon's opinion based on the principle (Chaggigah 10b) that "The Torah prohibited purposeful labor [on the Sabbath]." A deed is forbidden only when it is associated with a purposeful intent. (See also the notes on Halachah 7.)
The concept discussed in this halachah, אינו מתכוין, differs from an ordinary example of a labor performed unintentionally. When we speak of a labor performed unintentionally (בשוגג), the person had no thought whatsoever of performing a forbidden activity. In the case of אינו מתכוין, by contrast, the person performs an act consciously with the knowledge that there is a possibility that it may lead to a forbidden act. Nevertheless, since there is no certainty that the transgression will be committed, he is not held liable.
Although this principle is applicable to the Sabbath laws in particular, the difference of opinion between these two sages on this issue is relevant, not only to the Sabbath laws, but to all other prohibitions in the Torah as well.
Based on Pesachim 25b-26b, it appears that one is allowed to perform an activity that may result in the incidental performance of a forbidden labor even when one has an alternative manner of accomplishing one's objective, which does not involve any risk of a forbidden labor being performed. See Hilchot Kilayim 10:16.

What is implied? A person may drag a bed, a chair, a bench11Our text follows the standard published text of the Mishneh Torah, which quotes the text of Shabbat 22b. The original manuscripts of the Mishneh Torah substitute מגדל, "cabinet," instead of ספסל, "bench." and the like [on the ground] on the Sabbath, provided he does not intend to gouge out a groove in the earth while dragging them. Therefore, even if he did gouge out [a groove] in the ground [while dragging them], it is of no consequence, for he did not have this intent in mind.12Digging a groove is forbidden because it is included in the category of forbidden labor, plowing. Nevertheless, since one did not intend to perform this labor, the fact that it was performed is of no consequence. Similarly, all the subsequent activities mentioned by the Rambam involve the performance of a forbidden labor without the intent to do so.
Similarly, a person may tread on grass on the Sabbath, as long as his intent is not to uproot it. Thus, should it be uprooted, that is of no consequence. Also, a person may rub powdered herbs and the like over his hands, provided he does not intend to remove his hair.13See Chapter 22, Halachah 13. Therefore, if the hair is removed, it is of no consequence. Based on the same rationale, one may enter a narrow opening on the Sabbath even though, [while doing so,] one causes pieces of the wall to fall. Similarly, it is permissible to perform any act with similar repercussions, provided that one does not have the intent of doing so.

הלכה ו
אֲבָל עָשָׂה מַעֲשֶׂה וְנַעֲשֵׂית בִּגְלָלוֹ מְלָאכָה שֶׁוַּדַּאי תֵּעָשֶׂה בִּשְׁבִיל אוֹתוֹ מַעֲשֶׂה אַף עַל פִּי שֶׁלֹּא נִתְכַּוֵּן לָהּ חַיָּב. שֶׁהַדָּבָר יָדוּעַ שֶׁאִי אֶפְשָׁר שֶׁלֹּא תֵּעָשֶׂה אוֹתָהּ מְלָאכָה. כֵּיצַד. הֲרֵי שֶׁצָּרִיךְ לְרֹאשׁ עוֹף לְצַחֵק בּוֹ הַקָּטָן וְחָתַךְ רֹאשׁוֹ בְּשַׁבָּת אַף עַל פִּי שֶׁאֵין סוֹף מְגַמָּתוֹ לַהֲרִיגַת הָעוֹף בִּלְבַד חַיָּב שֶׁהַדָּבָר יָדוּעַ שֶׁאִי אֶפְשָׁר שֶׁיַּחְתֹּךְ רֹאשׁ הַחַי וְיִחְיֶה אֶלָּא הַמָּוֶת בָּא בִּשְׁבִילוֹ. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
6.
[In contrast,] when one performs a deed that results in the performance of a forbidden labor, and it is a certainty that this deed will cause [that labor] to be performed, one is liable14As mentioned in Halachah 2, the use of this term implies that the prohibition has its source in the Torah itself (the Rambam's son, Rabbenu Avraham). Although some authorities have explained that since the person had no intent for the labor itself, the prohibition is only Rabbinic in nature, from the Rambam's perspective it appears that since he knows that the labor will be performed, it is considered as if he performed it intentionally. even though one did not intend [to perform the forbidden labor].
What is implied? A person needs a fowl's head to serve as a toy for a child, and therefore cuts off the [fowl's] head on the Sabbath; although his ultimate purpose is not merely to slaughter the chicken,15The addition of the word "merely" implies that the person has a desire to slaughter the fowl. Albeit, his desire may not be to kill the fowl for food, but even for use as a toy it is preferable that the fowl be dead than alive.
This leads to another concept. The Aruch states that a person is not held liable when he performs an act that will inevitably bring about the commission of a forbidden labor, if he is displeased with the fact that the labor was committed (פסיק רישא דלא ניחא ליה). In his notes on Chapter 10, Halachah 17, Rabbenu Chayim Soloveitchik states that the Rambam also subscribes to this opinion.
The Shulchan Aruch (Orach Chayim 320:18) gives an example of this situation: The plug of a barrel of wine was closed with flax. Although some wine will inevitably be squeezed out when the barrel is unplugged - and squeezing is a forbidden labor - since the wine that is squeezed out will be lost, there is no prohibition.
This opinion is not, however, accepted by all authorities. Tosafot and Rabbenu Asher in their glosses on Shabbat 103a differ and maintain that, since it is inevitable that a forbidden labor will be performed, such an act is forbidden by Rabbinic decree. From the wording of the Shulchan Aruch's statements, it would appear that it is preferable to follow the more stringent view, but that the more lenient perspective has become popularly accepted.
he is liable. It is obvious that it is impossible for the head of a living being to be cut off and for that being to survive. Instead, the [fowl's] death came about because of [this activity]. [Therefore, he is liable.] The same applies in other similar situations.

הלכה ז
כָּל הָעוֹשֶׂה מְלָאכָה בְּשַׁבָּת אַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְגוּפָהּ שֶׁל מְלָאכָה חַיָּב עָלֶיהָ. כֵּיצַד. הֲרֵי שֶׁכִּבָּה אֶת הַנֵּר מִפְּנֵי שֶׁהוּא צָרִיךְ לַשֶּׁמֶן אוֹ לַפְּתִילָה כְּדֵי שֶׁלֹּא יֹאבַד אוֹ כְּדֵי שֶׁלֹּא יִשָּׂרֵף אוֹ כְּדֵי שֶׁלֹּא יִבָּקַע חֶרֶשׂ שֶׁל נֵר. מִפְּנֵי שֶׁהַכִּבּוּי מְלָאכָה וַהֲרֵי נִתְכַּוֵּן לְכַבּוֹת וְאַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְגוּף הַכִּבּוּי וְלֹא כִּבָּה אֶלָּא מִפְּנֵי הַשֶּׁמֶן אוֹ מִפְּנֵי הַחֶרֶשׂ אוֹ מִפְּנֵי הַפְּתִילָה הֲרֵי זֶה חַיָּב. וְכֵן הַמַּעֲבִיר אֶת הַקּוֹץ אַרְבַּע אַמּוֹת בִּרְשׁוּת הָרַבִּים אוֹ הַמְכַבֶּה אֶת הַגַּחֶלֶת כְּדֵי שֶׁלֹּא יִזּוֹקוּ בָּהֶן רַבִּים חַיָּב וְאַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְגוּף הַכִּבּוּי אוֹ לְגוּף הַהַעֲבָרָה אֶלָּא לְהַרְחִיק הַהֶזֵּק הֲרֵי זֶה חַיָּב. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
7.
Anyone who performs a [forbidden] labor - even if he has no need for the actual labor he performed - is liable for his deed.16This also represents a difference of opinion between Rabbi Yehudah and Rabbi Shimon bar Yochai, as evident from Shabbat 29b-30a, 73b, and other sources.
As in the laws mentioned in Halachah 7, the source of their difference of opinion is Rabbi Shimon's principle, "the Torah prohibited purposeful labor [on the Sabbath]." To explain: The prohibition against labor on the Sabbath is derived from the labors performed to construct the Sanctuary (see the commentary on Chapter 7, Law 1), and with regard to the construction of the Sanctuary, the Torah uses the expression, מלאכת מחשבת, "contemplative work." Accordingly, Rabbi Shimon maintains that the Torah's prohibition against labor is related to thought. Only when one's actions are purposeful can they be forbidden.
For this reason, Rabbi Shimon maintains - as explained in Halachah 5 - that when a person performs a forbidden labor without the intention to do so (אינו מתכוין), he is not liable. Although a forbidden activity results from his conduct, since his thought was not involved in the matter, his work does not resemble the labor that was necessary to construct the Sanctuary. Hence, one is not held liable for such labor on the Sabbath.
In the situation at hand, a מלאכה שאינה צריכה לגופה, the person performing the forbidden labor is doing so intentionally. Nevertheless, since his intent is not the same as that ordinarily associated - or according to some authorities, associated at the time of the construction of the Sanctuary - with this labor, he is not held liable. (See the comments of Rabbenu Avraham, the Rambam's son, quoted by the Kessef Mishneh.)
Rabbi Yehudah differs on both issues, maintaining that since the performance of a forbidden labor results from this person's conscious activity, he is held liable. The Rambam (following the opinion of Shemuel, Zevachim 92a) accepts Rabbi Shimon's view with regard to אינו מתכוין, but follows Rabbi Yehudah's view with regard to a מלאכה שאינה צריכה לגופה.
The difference between these opinions can be explained based on the interpretation of the command תשבות, "rest," on which basis we observe the Sabbath laws. We find another difference of opinion between Rabbi Yehudah and the other Sages (Pesachim 27a) concerning a word with a similar root. With regard to the command (Exodus 12:15 , תשביתו שאור, "destroy leaven," Rabbi Yehudah maintains that leaven must be burned. The other Sages (including Rabbi Shimon) maintain that leaven may be destroyed be other means.
What is the difference between them? Rabbi Yehudah maintains that the destruction of leaven must be utter and complete as possible, while the Sages maintain that all that is necessary is to negate its usefulness (potential for purposeful use). Similarly, in the present instance, Rabbi Yehudah explains that all semblances of labor are forbidden on the Sabbath. In contrast, Rabbi Shimon maintains that only purposeful labor is forbidden; only when both the activity and the intent for which it is performed are analogous to the activities performed to construct the Sanctuary is a transgression committed. (See Likkutei Sichot, Vol. 7, p. 190-191.)
Shemuel and the Rambam take an intermediate position. They agree with Rabbi Shimon that an activity must be coupled with a purposeful intent, but maintain that since a מלאכה שאינה צריכה לגופה is an intentional act, it is forbidden as such a combination.
It must be noted that the Rambam's view is not accepted by all authorities. The Ra'avad, Tosafot (Zevachim, ibid.) and subsequent Ashkenazic authorities state that Rabbi Shimon's opinion is accepted in both these instances. The Shulchan Aruch (Orach Chayim 278:1, 334:12) accepts Tosafot's decision. Nevertheless, even the authorities who accept Rabbi Shimon's view maintain that, if there is no danger to the community involved, a מלאכה שאינה צריכה לגופה is forbidden according to Rabbinic decree.

What is implied? A person extinguished a lamp because he needed [to save] the oil or the wick from being destroyed or from burning or so that the earthenware reservoir of the lamp [that holds the oil] would not break. Since he had the intent of extinguishing the lamp, even though he did not do so for the [usual] purpose of extinguishing,17I.e., his intent in extinguishing the lamp was not to produce coals to use for kindling an even flame, the purpose for which extinguishing was performed in constructing the Sanctuary. but merely for the sake of the oil, the wick or the earthenware, he is liable.
Similarly, a person who moves a thorn four cubits in the public domain or extinguishes a coal so that many people will not be injured by it, is liable. Although the [usual] purpose [served] by extinguishing [the coal] or moving [the thorn] is not important to him,18I.e., when constructing the Sanctuary, articles were transported because they were desired, and coals were extinguished to use for kindling an even flame. and his intent was merely to prevent injury, he is liable. The same applies in other similar situations.

הלכה ח
כָּל הַמִּתְכַּוֵּן לַעֲשׂוֹת מְלָאכָה וְנַעֲשָׂה לוֹ מְלָאכָה אַחֶרֶת שֶׁלֹּא נִתְכַּוֵּן לָהּ פָּטוּר עָלֶיהָ לְפִי שֶׁלֹּא נַעֲשֵׂית מַחֲשַׁבְתּוֹ. כֵּיצַד. זָרַק אֶבֶן אוֹ חֵץ בַּחֲבֵרוֹ אוֹ בִּבְהֵמָה כְּדֵי לְהָרְגָן וְהָלַךְ וְעָקַר אִילָן בַּהֲלִיכָתוֹ וְלֹא הָרַג הֲרֵי זֶה פָּטוּר. הֲרֵי זֶה קַל וָחֹמֶר אִם נִתְכַּוֵּן לְאִסּוּר קַל וְנַעֲשָׂה אִסּוּר חָמוּר. כְּגוֹן שֶׁנִּתְכַּוֵּן לִזְרֹק בְּכַרְמְלִית וְעָבְרָה הָאֶבֶן לִרְשׁוּת הָרַבִּים שֶׁהוּא פָּטוּר. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה. נִתְכַּוֵּן לַעֲשׂוֹת דָּבָר הַמֻּתָּר וְעָשָׂה דָּבָר אַחֵר כְּגוֹן שֶׁנִּתְכַּוֵּן לַחְתֹּךְ אֶת הַתָּלוּשׁ וְחָתַךְ אֶת הַמְחֻבָּר אֵינוֹ חַיָּב כְּלוּם. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
8.
Whenever a person intends to perform a forbidden labor, but instead [through his actions] causes the performance of another forbidden labor for which he had no intent, he is not liable, because his intent was not carried out.19Although the instance stated by the Rambam is not found in the Talmud, it is a logical extension of the principle stated in Keritot 19b and Shabbat 97b (and expressed in the following halachah), "The Torah prohibited purposeful labor [on the Sabbath]." Since the labor ultimately performed was not the one originally intended, this is not considered to be "purposeful work."
What is implied? A person threw a stone or shot an arrow at a colleague or at an animal with the intent of slaying them. Should [the object that he propelled] uproot a tree in its progress and not kill [the intended victim], he is free of liability.
How much more so does this principle apply if one had the intent of performing a lesser transgression and one performed a more serious one. For example, a person intended to throw [a stone] into a carmelit,20As explained in Chapter 14, Halachah 4, a carmelit is a domain in which the Sages applied the prohibitions against transporting and throwing articles which apply in the public domain by virtue of Torah law. Thus, the person had the intent of violating merely a Rabbinic law. and instead, the stone passed into the public domain.21The Maggid Mishneh draws attention to Chapter 13, Halachah 21, which states that even when a person intended to throw an object four cubits in the public domain and instead the object traveled eight cubits, he is not held liable, because he did not accomplish his intent. Hence, he explains that the intent is not that the public domain is beyond the carmelit and the object did not rest in the carmelit as intended, but rather continued to the public domain.
Instead, the Rambam is referring to an instance where a person is standing in a private domain with both a public domain and a carmelit before him. Although he intended to throw the object into the carmelit, it traveled into the public domain.
He is not held liable. The same applies in other similar circumstances.
Should a person have the intent of performing a permitted act and instead perform another act [which is forbidden], he is not held liable.22See Hilchot Shegagot 7:11. This halachah represents a progressive sequence. In the first instance mentioned, the forbidden activity the person intended to perform was not performed at all. In the second instance, he intended to perform the forbidden activity - removing an object from his property - but his intent was not to transgress a Torah prohibition. In this third instance, the person had the intent of performing the activity that he performed for the sake of the result that activity produced. Nevertheless, since he desired to perform this activity with a permitted entity and that aspect of the desire was not fulfilled, he is not held liable (Rav Kapach). For example, should he intend to cut produce that was not attached to the ground, and instead cut produce attached to the ground,23The Maggid Mishneh offers two different interpretations of the Rambam's words: one that the person cut a different plant from the one he intended to cut, and one that he thought the plant he intended to cut had been detached from the earth, and discovered that it was attached. Although, both interpretations are halachically acceptable, the Maggid Mishneh favors the second one. The Kovetz and other authorities, however, favor the first. he is not held liable. The same applies in other similar situations.

הלכה ט
נִתְכַּוֵּן לִלְקֹט תְּאֵנִים שְׁחוֹרוֹת וְלִקֵּט לְבָנוֹת אוֹ שֶׁנִּתְכַּוֵּן לִלְקֹט תְּאֵנִים וְאַחַר כָּךְ עֲנָבִים וְנֶהְפַּךְ הַדָּבָר וְלִקֵּט הָעֲנָבִים בַּתְּחִלָּה וְאַחַר כָּךְ תְּאֵנִים פָּטוּר אַף עַל פִּי שֶׁלִּקֵּט כָּל מַה שֶּׁחָשַׁב הוֹאִיל וְלֹא לִקֵּט כַּסֵּדֶר שֶׁחָשַׁב פָּטוּר שֶׁבְּלֹא כַּוָּנָה עָשָׂה שֶׁלֹּא אָסְרָה תּוֹרָה אֶלָּא מְלֶאכֶת מַחְשֶׁבֶת:
כסף משנה
9.
Should a person intend24This halachah develops the theme stated in the previous halachah, giving a further example of a case where a person is not held liable for a forbidden activity he performed, because of the principle, "The Torah prohibited purposeful labor [on the Sabbath]." to pick black figs and pick white figs instead25The difference in the color of the figs causes them to be regarded as two different types of fruit. This is significant, as is obvious from the contrast to the following halachah. - or should he intend first to pick figs and then to pick grapes, but instead picked grapes and then figs - he is not liable.26The Ra'avad takes issue with this point, arguing that since the person picking the fruit accomplished his objective, he should be held liable. It is insignificant that the order in which he picked them differed from that which he originally intended.
It can be explained, based on Keritot 19b, that the Rambam's understanding is that for a person to be held liable, not only must he accomplish his ultimate intent, but also, while he is performing the labor, his actions must be controlled by his thoughts.
Commenting on the difference of opinion between the Rambam and the Ra'avad, the Maggid Mishneh notes that there is no difference regarding practical halachah at present. The only difference will be in the Era of the Redemption, at which time there will be a question whether it is necessary for such a person to bring a sin offering or not, and in that era, "the righteous instructor (Mashiach) will come" and render a decision.
He in fact picked everything that he desired, but because he did not pick them in the order that he intended, he is not held liable, since he did not act according to his intent. It is "purposeful labor" that the Torah forbade.

הלכה י
הָיוּ לְפָנָיו שְׁתֵּי נֵרוֹת דּוֹלְקוֹת אוֹ כְּבוּיוֹת נִתְכַּוֵּן לְכַבּוֹת זוֹ וְכִבָּה אֶת זוֹ לְהַדְלִיק זוֹ וְהִדְלִיק אֶת זוֹ חַיָּב שֶׁהֲרֵי עָשָׂה מִן הַמְּלָאכָה שֶׁחָשַׁב לַעֲשׂוֹתָהּ. הָא לְמָה הוּא דּוֹמֶה לְמִי שֶׁנִּתְכַּוֵּן לִלְקֹט תְּאֵנָה זוֹ וְלִקֵּט תְּאֵנָה אַחֶרֶת. אוֹ לְמִי שֶׁנִּתְכַּוֵּן לַהֲרֹג אֶת זֶה וְהָרַג אֶת זֶה שֶׁהֲרֵי נַעֲשֵׂית מְלָאכָה שֶׁחָשַׁב לַעֲשׂוֹתָהּ:
כסף משנה
10.
When a person had two candles before him and both of them were either burning or extinguished, and he desired to kindle or extinguish one, but instead he kindled or extinguished the other, he is liable,27This is the text of Keritot 20a according to the Rambam and others. Our text of Keritot differs and frees a person of liability in such an instance. On this basis, the Ra'avad and others challenge the Rambam's position. for he performed the [forbidden] labor that he intended to perform.28In contrast to the previous halachah, this is speaking about an instance where the person does not derive any advantage from kindling or extinguishing either candle; he merely wants to kindle or extinguish a candle. The same effect results from kindling or extinguishing one as the other. Hence he is liable, for he performed a forbidden labor, and he is considered to have performed it willfully. Were there to be an advantage to kindling or extinguishing one of the two candles, the situation would resemble that described in Halachah 11.
To what can the matter be compared? To a person who intended to pick one fig and picked another instead, or to a person who desired to kill one [living being]29The intent does not appear to be that he desired to kill a person, for it is highly unlikely that there would be no difference killing one person or the other. Rather, the Rambam appears to be referring to the killing of an insect or an animal, an act that is also forbidden on the Sabbath. and killed another instead. [He is liable,] because the [forbidden] labor which he intended to do was performed.

הלכה יא
אֲבָל אִם נִתְכַּוֵּן לְהַדְלִיק רִאשׁוֹנָה וּלְכַבּוֹת שְׁנִיָּה אַחֲרֶיהָ וְנֶהְפַּךְ הַדָּבָר וְכִבָּה רִאשׁוֹנָה וְאַחַר כָּךְ הִדְלִיק שְׁנִיָּה אַחֲרֶיהָ פָּטוּר. כִּבָּה זוֹ וְהִדְלִיק זוֹ בִּנְשִׁימָה אַחַת חַיָּב. שֶׁאַף עַל פִּי שֶׁלֹּא הִקְדִּים הַהַדְלָקָה הֲרֵי זֶה לֹא אִחֵר אוֹתָהּ אֶלָּא שְׁתֵּיהֶן כְּאַחַת וּלְפִיכָךְ חַיָּב. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה. וְכָל הָעוֹשֶׂה מְלָאכָה בְּמִתְעַסֵּק וְלֹא נִתְכַּוֵּן לָהּ פָּטוּר:
כסף משנה
11.
One is, however, freed of liability [in the following instance: There were two candles before a person, one lit and one extinguished.30The bracketed additions are made on the basis of Keritot 20a.] The person intended to kindle the [one that was extinguished] first and to extinguish the second candle afterwards. Nevertheless, the order [of his actions] became reversed, and instead, he extinguished the candle first and kindled the second candle afterwards.31As in Halachah 9, the fact that the person did not perform the tasks in the order in which he originally intended indicates that, at the time he performed them, he was not in control of his deeds. Hence, this is not considered to be "purposeful work." In this instance as well, the Ra'avad differs and holds the person liable.
The new concept this halachah teaches is that even when the tasks which the person intended to perform involve two separate labors (as opposed to Halachah 9 when only a single forbidden labor is involved), he is held liable only when he performs the tasks in the order he originally intended.

If he extinguished one and kindled the other in a single breath, he is liable. Although he did not kindle the first candle before [extinguishing the other], he did not delay [its lighting], and performed both activities simultaneously. Therefore, he is liable.32Since the order in which the person desired to perform the activity was not reversed, his actions are "purposeful work." The same applies in other similar circumstances.
Whenever a person performs a [forbidden] labor casually, without specific intention, he is not liable.33Rashi, Keritot 19b, differentiates between this type of behavior, referred to as מתעסק, and an inadvertent transgression of a commandment (שוגג) as follows: When a person transgresses בשוגג, he willfully performs the forbidden activity, but is unaware of the prohibition involved. In all the situations described as מתעסק, the person may be aware of the prohibition, but is not consciously controlling his behavior.

הלכה יב
כָּל הַמִּתְכַּוֵּן לַעֲשׂוֹת מְלָאכָה וְנַעֲשֵׂית בְּיוֹתֵר עַל כַּוָּנָתוֹ חַיָּב. בְּפָחוֹת מִכַּוָּנָתוֹ פָּטוּר. כֵּיצַד. הֲרֵי שֶׁנִּתְכַּוֵּן לְהוֹצִיא מַשָּׂא לְאַחֲרָיו וּבָא לוֹ לְפָנָיו חַיָּב שֶׁהֲרֵי נִתְכַּוֵּן לִשְׁמִירָה פְּחוּתָה וְנַעֲשֵׂית שְׁמִירָה מְעֻלָּה. אֲבָל אִם נִתְכַּוֵּן לְהוֹצִיא לְפָנָיו וּבָא לוֹ לְאַחֲרָיו פָּטוּר שֶׁהֲרֵי נִתְכַּוֵּן לְהוֹצִיא בִּשְׁמִירָה מְעֻלָּה וְהוֹצִיא בִּשְׁמִירָה פְּחוּתָה. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
12.
Whenever a person intended to perform a forbidden labor and performed it more effectively than he had originally intended, he is liable.34Although he accepts the Rambam's premise, the Ra'avad objects to the wording the Rambam chose, explaining that there is an instance - a person who desired to write the name שמעון and instead, wrote the name שם - where a person does not fulfill his intention and is still liable.
The Maggid Mishneh explains that in that instance, the person also had the intent to write the letters of the name שם and is therefore held liable, as implied by Halachah 14. By putting the focus on intent, the Rambam emphasizes that the leniency stated in this halachah is also an outgrowth of the principle that "The Torah prohibited purposeful work."
If [he performs it] less effectively than he had originally intended, he is not liable.35As mentioned at the beginning of the chapter, the expression "he is not liable," means that a person should not be punished - nor is he liable to bring a sin offering - for his deed. Nevertheless, performing such a deed constitutes the violation of a Rabbinic prohibition. As mentioned, this concept is applicable throughout this chapter, and indeed throughout the Mishneh Torah as a whole.
What is implied? A person intended to carry a burden suspended behind him and instead, it swung in front of him. He is liable, for he intended to protect it in a less effective manner, and it was ultimately protected in a more effective manner. If, however, he intended to carry a burden suspended before him, and instead it swung behind him, he is not liable, for he intended to protect it in a more effective manner and, it was ultimately protected in a less effective manner.

הלכה יג
הָיָה חָגוּר בְּסִנָּר וְהִשְׁלִיךְ הַמַּשָּׂא בֵּין בְּשָׂרוֹ וַחֲלוּקוֹ בֵּין שֶׁבָּא זֶה הַמַּשָּׂא שֶׁדַּרְכּוֹ לְהוֹצִיאוֹ בַּדֶּרֶךְ הַזֹּאת לְפָנָיו בֵּין שֶׁבָּא לְאַחֲרָיו חַיָּב שֶׁכֵּן דַּרְכּוֹ לִהְיוֹת חוֹזֵר:
כסף משנה
13.
[A person who transfers an article from one domain to another is held liable in the following situation]: He was wearing a belt36Our translation is based on the Rambam's Commentary on the Mishnah, Shabbat 10:4. Rashi and others offer alternate definitions of the term. and he placed a burden that is commonly transferred in this manner between his body and his garment. Whether the burden hung in front of him or it had shifted behind him [at the time he transferred it], he is held liable, since it is likely to shift position.37The intent here is that since it is usual for the article to shift position in such an instance, this is considered to be part of the person's original intent.
Although this law is more specific than most mentioned in this chapter, it is still worthy of mention, because it illustrates how a person's intention can be general in nature and include several different possible ways in which a forbidden labor could be performed.

הלכה יד
כָּל הַמִתְכַּוֵּן לַעֲשׂוֹת מְלָאכָה בְּשַׁבָּת וְהִתְחִיל בָּהּ וְעָשָׂה כַּשִּׁעוּר חַיָּב. אַף עַל פִּי שֶׁלֹּא הִשְׁלִים כָּל הַמְּלָאכָה שֶׁנִּתְכַּוֵּן לְהַשְׁלִימָהּ. כֵּיצַד. הֲרֵי שֶׁנִּתְכַּוֵּן לִכְתֹּב אִגֶּרֶת אוֹ שְׁטָר בְּשַׁבָּת אֵין אוֹמְרִים לֹא יִתְחַיֵּב זֶה עַד שֶׁיַּשְׁלִים חֶפְצוֹ וְיִכְתֹּב כָּל הַשְּׁטָר אוֹ כָּל הָאִגֶּרֶת אֶלָּא מִשֶּׁיִּכְתֹּב שְׁתֵּי אוֹתִיּוֹת חַיָּב. וְכֵן אִם נִתְכַּוֵּן לֶאֱרֹג בֶּגֶד שָׁלֵם מִשֶּׁיֶאֱרֹג שְׁנֵי חוּטִין חַיָּב וְאַף עַל פִּי שֶׁכַּוָּנָתוֹ לְהַשְׁלִים הַבֶּגֶד הוֹאִיל וְעָשָׂה כַּשִּׁעוּר בְּכַוָּנָה חַיָּב. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
14.
Whenever a person desired to perform a [forbidden] labor on the Sabbath, began the performance of that labor, and performed an amount of work sufficient to incur liability,38Here the Rambam introduces a new concept, שיעור, the amount of work sufficient to incur liability. When the Torah forbade the performance of labor on the Sabbath, it also specified that a person is not held liable unless his activities are sufficient to bring about a significant result. Thus, a particular שיעור was established for every specific labor.
A similar concept applies with regard to other prohibitions. For example, with regard to most forbidden foods one is not held liable unless one eats an amount equivalent to the size of an olive.
[Yoma 74 discusses whether a person who performs a forbidden activity, but does so involving less than a שיעור, is considered to have violated a prohibition from the Torah (although he is not liable for punishment or a sin offering) or whether he is considered to have violated merely a Rabbinic commandment.]
he is held liable, even if he did not complete the task he desired to perform.39One might think that since the person did not complete his intended objective, his activity is not considered "purposeful labor." The Rambam explains, however, that since the work the person did complete was performed "purposefully," and since he completed a significant amount of work (a שיעור), he is held liable.
For example, a person desired to write a note or a contract on the Sabbath. We do not say that he is not liable until he completes his desire and writes the entire note or contract. Instead, as soon as he writes two letters, he is liable.40See Chapter 11, Halachah 9.
Similarly, a person who desires to weave an entire garment is held liable after weaving two strands.41See Chapter 9, Halachah 18. Although he intended to complete [the entire garment], he is held liable because he intentionally performed the amount of work sufficient to incur liability. The same applies in all similar situations.

הלכה טו
כָּל מְלָאכָה שֶׁהַיָּחִיד יָכוֹל לַעֲשׂוֹת אוֹתָהּ לְבַדּוֹ וְעָשׂוּ אוֹתָהּ שְׁנַיִם בְּשֻׁתָּפוּת בֵּין שֶׁעָשָׂה זֶה מִקְצָתָהּ וְזֶה מִקְצָתָהּ כְּגוֹן שֶׁעָקַר זֶה הַחֵפֶץ מֵרְשׁוּת זוֹ וְהִנִּיחוֹ הַשֵּׁנִי בִּרְשׁוּת אַחֶרֶת בֵּין שֶׁעָשׂוּ אוֹתָהּ שְׁנֵיהֶם כְּאֶחָד מִתְּחִלָּה וְעַד סוֹף כְּגוֹן שֶׁאָחֲזוּ שְׁנֵיהֶם בְּקֻלְמוֹס וְכָתְבוּ אוֹ אָחֲזוּ כִּכָּר וְהוֹצִיאוּהוּ מֵרְשׁוּת לִרְשׁוּת הֲרֵי אֵלּוּ פְּטוּרִין:
כסף משנה
15.
Whenever two people share in the performance of a [forbidden] labor that one of them could have performed by himself,42A situation in which a forbidden labor requires the efforts of more than one individual is discussed in the following halachah. they are [both] free of liability.43Shabbat 3a derives this from the exegesis of Leviticus 4:27, explaining that that verse teaches that one is liable only "when one performs the entire labor and not a portion of it; when one person performs the labor and not two."
See also Rashi, Shabbat 93a and Shulchan Aruch HaRav 316:7 explain that a person is not liable for performing a labor in this manner, because this is not the ordinary manner in which the labor is performed.

This applies whether one performed part of the [forbidden] labor and the other performed the remainder - e.g., one removed an article from one domain and the other placed it down in the other domain - or they both performed the [forbidden] labor together from the beginning to the end. For example, they both held a pen and wrote, or they both held a loaf of bread and transferred it from one domain to another.

הלכה טז
וְאִם אֵין אֶחָד מֵהֶן יָכוֹל לַעֲשׂוֹתָהּ לְבַדּוֹ עַד שֶׁיִּצְטָרְפוּ כְּגוֹן שְׁנַיִם שֶׁאָחֲזוּ קוֹרָה וְהוֹצִיאוּהָ לִרְשׁוּת הָרַבִּים הוֹאִיל וְאֵין כֹּחַ בְּאֶחָד מֵהֶן לַעֲשׂוֹתָהּ לְבַדּוֹ וְעָשׂוּ אוֹתָהּ בְּשֻׁתָּפוּת מִתְּחִלָּה וְעַד סוֹף שְׁנֵיהֶן חַיָּבִין וְשִׁעוּר אֶחָד לִשְׁנֵיהֶן. הָיָה כֹּחַ בְּאֶחָד לְהוֹצִיא קוֹרָה זוֹ לְבַדּוֹ וְהַשֵּׁנִי אֵינוֹ יָכוֹל לְהוֹצִיאָהּ לְבַדּוֹ וְנִשְׁתַּתְּפוּ שְׁנֵיהֶם וְהוֹצִיאוּהָ. זֶה הָרִאשׁוֹן שֶׁיָּכוֹל חַיָּב וְהַשֵּׁנִי מְסַיֵּעַ הוּא וּמְסַיֵּעַ אֵינוֹ חַיָּב כְּלוּם. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
16.
When, however, a single individual cannot perform [the forbidden labor] alone and must be joined by others, [all the individuals involved are held liable].44Rabbi Akiva Eiger writes that the same applies when a forbidden labor is performed by three or more individuals and the performance of the forbidden labor requires the efforts of all the individuals involved. Nevertheless, if three individuals perform a forbidden labor and it requires only the efforts of two, none of the individuals is held liable, for no one is capable of performing the task alone. For example, two people held a beam and transferred it to the public domain. Since neither one of them had the strength to perform this task alone,45Tosafot, Shabbat 93a emphasizes that the matter is not dependent on strength alone. Even when a person has sufficient strength to carry an object alone, but requires a second person's assistance because of the object's bulk, neither is liable. In practice, the transfer of the object requires both their efforts. and they performed it together from the beginning to the end, they are both held liable. The minimum amount of work for which they are held liable is the same as for a single individual who performs such a task.
[The following decision applies when] one of them has sufficient strength to transfer the beam alone, but the other is unable to transfer it alone. If they join together and transfer the beam, the one who is capable [of moving it himself] is held liable. The second one is considered [merely] as offering assistance, and a person who offers assistance [in this fashion] is not liable at all.46This principle is also applied in other contexts aside from the laws of the Sabbath. (See Hilchot Tum'at Mishkav UMoshav 7:6 and Hilchot Bi'at HaMikdash 5:18. See also the commentary to the Moznaim edition of Hilchot Tefillin 1:11.) The same applies in other similar situations.

הלכה יז
כָּל הַמְקַלְקְלִין פְּטוּרִין. כֵּיצַד. הֲרֵי שֶׁחָבַל בַּחֲבֵרוֹ אוֹ בִּבְהֵמָה דֶּרֶךְ הַשְׁחָתָה וְכֵן אִם קָרַע בְּגָדִים אוֹ שְׂרָפָן אוֹ שָׁבַר כֵּלִים דֶּרֶךְ הַשְׁחָתָה הֲרֵי זֶה פָּטוּר. חָפַר גּוּמָא וְאֵינוֹ צָרִיךְ אֶלָּא לַעֲפָרָהּ הֲרֵי זֶה מְקַלְקֵל וּפָטוּר. אַף עַל פִּי שֶׁעָשָׂה מְלָאכָה הוֹאִיל וְכַוָּנָתוֹ לְקַלְקֵל פָּטוּר:
כסף משנה
17.
Whenever [a forbidden labor is performed] in a destructive manner, one is not held liable.47As mentioned previously, the prohibition against labor on the Sabbath was derived from a comparison to the labors performed in the construction of the Sanctuary. In that instance, all the labors had a positive intent.
(The Rambam's statements imply that performing a forbidden labor with a destructive intent is not forbidden by the Torah at all, but is merely a Rabbinic prohibition. There are opinions which differ, and maintain that although the Torah did not hold one liable in such an instance, the act is forbidden by the Torah itself.)
What is implied? A person who injures a colleague or an animal with a destructive intent,48However, see Chapter 8, Halachah 8, which states that if a person injures another person as an expression of anger, he is liable, for in his own mind his activity is constructive; he is releasing pent up emotion. one who rips or burns garments, or one who breaks utensils with a destructive intent is not held liable.
A person who dug a pit solely because he needed the earth inside it is considered as having performed a [forbidden] labor with a destructive intent, and is therefore free of liability.49The Maggid Mishneh and others note that this activity is only destructive when the pit is dug within a home. Digging a pit for the sake of its earth in a field, by contrast, is not considered a destructive act. It is, however, a מלאכה שאינה צריכה לגופה (see Halachah 7), for the digger has no desire for the pit, the object of the work. As mentioned, other authorities free a person in such an instance; the Rambam, however, would normally hold one liable. Although he performed a [forbidden] labor, he is not held liable because he had a destructive intent.

הלכה יח
כָּל הַמְקַלְקֵל עַל מְנָת לְתַקֵּן חַיָּב. כֵּיצַד. הֲרֵי שֶׁסָּתַר כְּדֵי לִבְנוֹת בִּמְקוֹמוֹ אוֹ שֶׁמָּחַק כְּדֵי לִכְתֹּב בַּמָּקוֹם שֶׁמָּחַק אוֹ שֶׁחָפַר גּוּמָא כְּדֵי לִבְנוֹת בְּתוֹכָהּ יְסוֹדוֹת וְכָל כַּיּוֹצֵא בָּזֶה חַיָּב. וְשִׁעוּרָן כְּשִׁעוּר הַמְתַקֵּן:
כסף משנה
18.
Whenever a person carries out a destructive activity for the sake of ultimately performing a constructive activity, he is liable.50Indeed, several of the 39 categories of labor forbidden on the Sabbath - e.g., tearing, erasing, and demolishing - involve activities that are essentially destructive in nature. Nevertheless, when one performs these activities for an ultimate constructive intent, one is held liable. For example, a person who demolishes [a structure] in order to build [another] in its place,51The commentaries note the contrast between the Rambam's wording in this halachah and in Chapter 10, Halachah 15, where he omits the expression, "in its place." Accordingly, the commentaries question whether one is liable for demolishing a building for the sake of building another, when the other building will not be built in the place of the first. (See the gloss of the Or Sameach on Chapter 10, Halachah 12.) one who erased for the sake of writing [something else] in the place of the erasure, or one who dug a pit in order to place the foundations of a structure within. The same applies in other similar situations.
The minimum measure of the destructive activity for which he is held liable is equal to that of the correspondent positive activity.52For example, the minimum measure (שיעור) for which one is liable for the constructive act of writing is two letters. Therefore, one is liable for erasing two letters. Moreover, as stated in Chapter 11, Halachah 9, a person is liable when he erases one letter which is large enough for two to be written in its place.

הלכה יט
כָּל הָעוֹשֶׂה מְלָאכָה בְּשַׁבָּת מִקְצָתָהּ בְּשׁוֹגֵג וּמִקְצָתָהּ בְּזָדוֹן בֵּין שֶׁהֵזִיד וּלְבַסּוֹף שָׁגַג בֵּין שֶׁשָּׁגַג וּלְבַסּוֹף הֵזִיד פָּטוּר עַד שֶׁיַּעֲשֶׂה שִׁעוּר הַמְּלָאכָה כֻּלָּהּ מִתְּחִלָּה וְעַד סוֹף בְּזָדוֹן וְאַחַר כָּךְ יִהְיֶה חַיָּב כָּרֵת. וְאִם יִהְיֶה בְּעֵדִים וְהַתְרָאָה חַיָּב סְקִילָה. אוֹ שֶׁיַּעֲשֶׂה שִׁעוּר מְלָאכָה כֻּלָּהּ בִּשְׁגָגָה מִתְּחִלָּה וְעַד סוֹף וְאַחַר כָּךְ יִהְיֶה חַיָּב חַטָּאת קְבוּעָה:
כסף משנה
19.
Whenever a person performs a [forbidden] labor on the Sabbath, partially with intent and partially unintentionally,53The definition of "unintentionally" (בשוגג) is that one is unaware that the activity is forbidden, or one is unaware that the day is the Sabbath. Thus, the situation described by the Rambam would involve, for example, writing one letter knowing that it is the Sabbath and that it is forbidden to do so, and writing a second letter having forgotten either of these factors. he is not liable. [This law applies] regardless of whether one began the performance of the [forbidden] labor intentionally and completed it unintentionally, or one began the [forbidden] labor unintentionally and completed it intentionally.
One is liable for karet only when one performs the entire minimum measure of a [forbidden] labor intentionally from the beginning to the end. [In such a circumstance,] were witnesses who administered a warning to be present, one would be liable for execution by stoning.54See Halachah 1. Conversely, one is liable to bring a sin offering of a fixed nature55See Halachah 1. when one performs the entire minimum measure of a [forbidden] labor unintentionally from the beginning to the end.

זמנים הלכות שבת פרק א
Zemanim Shabbos Chapter 1