Halacha

הלכה א
אָסוּר לוֹמַר לְנָכְרִי לַעֲשׂוֹת לָנוּ מְלָאכָה בְּשַׁבָּת אַף עַל פִּי שֶׁאֵינוֹ מְצֻוֶּה עַל הַשַּׁבָּת. וְאַף עַל פִּי שֶׁאָמַר לוֹ מִקֹּדֶם הַשַּׁבָּת. וְאַף עַל פִּי שֶׁאֵינוֹ צָרִיךְ לְאוֹתָהּ מְלָאכָה אֶלָּא לְאַחַר הַשַּׁבָּת. וְדָבָר זֶה אָסוּר מִדִּבְרֵי סוֹפְרִים כְּדֵי שֶׁלֹּא תִּהְיֶה שַׁבָּת קַלָּה בְּעֵינֵיהֶן וְיָבוֹאוּ לַעֲשׂוֹת בְּעַצְמָן:
כסף משנה
1.
It is forbidden for us to tell1See the Rambam's Commentary on the Mishnah (Machshirin 2:5-6), which states that it is forbidden even to hint to a gentile that one desires that he perform a forbidden labor on one's behalf. This ruling is accepted by the Ramah (Orach Chayim 307:22). Nevertheless, Shulchan Aruch HaRav 307:7 and the Mishnah Berurah 307:76 allow one to make an indirect hint in certain situations. a gentile to perform work on the Sabbath on our behalf, although they are not commanded [to observe] the Sabbath.2On the contrary, a gentile who observes the Sabbath is liable for death (Sanhedrin 58b, Hilchot Melachim 10:9). [This applies] even when the instructions were conveyed to them before the Sabbath and we do not require [the products of] their work until after the Sabbath.
The above is forbidden as a Rabbinical prohibition to prevent the people from regarding the Sabbath lightly, lest they perform [forbidden] labor themselves.3The Tur and the Shulchan Aruch (Orach Chayim 307:1-2) mention another reason for the prohibition against conveying such instructions on the Sabbath itself, so that one should not talk about mundane matters on the Sabbath.
[On the basis of this rationale, we can understand the lenient opinions mentioned in note 1. Since the prohibition against instructing a gentile to perform work stems from the prohibition against speaking of mundane matters, there is room for leniency if the instruction is conveyed without speech.]
Shulchan Aruch HaRav 243:1 also mentions an opinion that maintains that a gentile performing a labor on behalf of a Jew on the Sabbath is considered as the Jews's agent. Hence, the Jew is held responsible for the work.

הלכה ב
נָכְרִי שֶׁעָשָׂה מְלָאכָה מֵעַצְמוֹ בְּשַׁבָּת אִם בִּשְׁבִיל יִשְׂרָאֵל עָשָׂה אוֹתָהּ אָסוּר לֵהָנוֹת בְּאוֹתָהּ מְלָאכָה עַד מוֹצָאֵי שַׁבָּת וְיַמְתִּין בִּכְדֵי שֶׁתֵּעָשֶׂה. וְהוּא שֶׁלֹּא יְהֵא הַדָּבָר בְּפַרְהֶסְיָא עַד שֶׁיֵּדְעוּ בּוֹ רַבִּים שֶׁדָּבָר זֶה בִּשְׁבִיל פְּלוֹנִי הוּא נַעֲשָׂה בְּשַׁבָּת. וְאִם בִּשְׁבִיל עַצְמוֹ בִּלְבַד עָשָׂה מֻתָּר לֵהָנוֹת בָּהּ בְּשַׁבָּת:
כסף משנה
2.
[The following rules4Examples of the principles mentioned in this halachah are given in Halachot 3-8. apply] when a gentile performs a [forbidden] labor on the Sabbath on his own accord:5I.e., even without receiving specific instructions from a Jew. If he performed it on behalf of a Jew, it is forbidden to benefit from that labor6The entire Jewish people, not only the person for whom the forbidden labor was performed, are prohibited from benefiting from it (Maggid Mishneh, Shulchan Aruch 325:10). until one waits the amount of time necessary to perform the labor on Saturday night.7See Halachah 8.
[The latter leniency is granted] provided the matter is not public notice - i.e., everyone knows that a particular task is being performed for a person on the Sabbath.8The Rambam's mention of this principle is significant. In the interpretation of Shabbat 24:3 - the Mishnah that serves as the basis for Halachah 8 - there are authorities (e.g., Rabbenu Nissim) who explain that the prohibition against benefiting from forbidden labors performed by a gentile in public on the Sabbath applies only in the specific context mentioned in that Mishnah: a grave, coffin, or flutes for mourning a deceased person.
A prohibition was instituted in these instances alone, for it is improper that a person's final resting be associated with the performance of labor on the Sabbath. In contrast, when a Sabbath prohibition is performed on behalf of a living person, one may benefit from it after the Sabbath.
From the Rambam's statements in this halachah, it is obvious that he does not allow such leniency. Note Shulchan Aruch HaRav 325:21 and the Mishnah Berurah 325:73, which explain that if the situation requires it, Rabbenu Nissim's opinion can be relied on.

If [the gentile] performed [the labor] for his own sake alone,9With this addition, the Rambam implies that if the gentile performs the forbidden labor for his own sake and with the intention that it also benefit a Jew, it is forbidden. (See Shulchan Aruch, Orach Chayim 276:2.) it is permitted to benefit from it on the Sabbath.

הלכה ג
כֵּיצַד. נָכְרִי שֶׁהִדְלִיק אֶת הַנֵּר מִשְׁתַּמֵּשׁ לְאוֹרוֹ יִשְׂרָאֵל וְאִם בִּשְׁבִיל יִשְׂרָאֵל אָסוּר. עָשָׂה נָכְרִי כֶּבֶשׁ לֵירֵד בּוֹ מִן הַסְּפִינָה יֵרֵד אַחֲרָיו יִשְׂרָאֵל וְאִם בִּשְׁבִיל יִשְׂרָאֵל אָסוּר. מִלֵּא מַיִם לְהַשְׁקוֹת בְּהֶמְתּוֹ מַשְׁקֶה אַחֲרָיו יִשְׂרָאֵל וְאִם בִּשְׁבִיל יִשְׂרָאֵל אָסוּר. לִקֵּט עֲשָׂבִים לְהַאֲכִיל לִבְהֶמְתּוֹ מַנִּיחַ יִשְׂרָאֵל בְּהֶמְתּוֹ לֶאֱכל מֵהֶן. וְהוּא שֶׁלֹּא יְהֵא אוֹתוֹ הַנָּכְרִי מַכִּיר לְאוֹתוֹ יִשְׂרָאֵל שֶׁמָּא יַרְבֶּה בִּמְלַאכְתּוֹ בִּשְׁבִילוֹ וְנִמְצָא עוֹשֶׂה בִּשְׁבִיל יִשְׂרָאֵל. וְכֵן כָּל דָּבָר שֶׁאֶפְשָׁר לְהַרְבּוֹת בּוֹ לֹא יֵהָנֶה בּוֹ בְּשַׁבָּת אֶלָּא אִם כֵּן אֵינוֹ מַכִּירוֹ:
כסף משנה
3.
What is implied? If a gentile kindled a candle [for his own benefit], a Jew is also permitted to perform activity by its light.10The Shulchan Aruch (loc. cit.:1) states that one may also benefit from a lamp kindled by a gentile on behalf of a person who is ill. If [the gentile] kindled the light on behalf of the Jew, it is forbidden.11The Ramah (loc. cit.) states that if a gentile lights a lamp or a fire in a Jew's house on his own accord, the Jew is not required to leave his home. Although he should try not to benefit from the light, the fact that he receives benefit against his will is not of significance.
Similarly, if a gentile made a ramp to descend from a ship [himself], a Jew may descend after him.12Shabbat 122a gives a classic example of this halachah. Rabban Gamliel and several other Sages descended from a ship on a ramp made by a gentile on the Sabbath. If he made it for the Jew, it is forbidden.13Note the contrast between this pair of examples and the following pair, as explained in the following halachah. If he filled a trench with water to allow his animal to drink, a Jew may have his own animal drink afterwards. If he did so for the sake of the Jew, it is forbidden.14The Shulchan Aruch (loc. cit. 325:10) states that this prohibition applies only when one is drawing from a well in a private domain into the public domain, for this involves the transgression of a Torah prohibition. More leniency is allowed when water is drawn from a well in a private domain to a carmelit, for then merely a Rabbinic prohibition is involved. In such an instance, anyone other than the person for whom the water was drawn may benefit from it.
The Ramah (loc. cit.) mentions a more lenient perspective, which states that whenever it is possible for a Jew to accomplish an objective without performing a forbidden labor, he may benefit from a forbidden labor that a gentile performed for the Jew's sake, which made the objective easier to accomplish. For example, since a Jew could have descended to a well to drink water, he is allowed to drink water that a gentile brought from the well for him.

If a [gentile] gathered grass to feed his animal, a Jew may bring his animal to eat from it15The Maggid Mishneh and the Shulchan Aruch (loc. cit. 325:11) explain that one may not give this grass to the animal or even lead him directly toward it, because the grass is muktzeh. provided that the gentile does not know this Jew. [If he does, it is forbidden,16Not only for him, but for other Jews as well (Shulchan Aruch, loc. cit.:10).] lest he bring more on his behalf at which point he would be performing a [forbidden] labor on behalf of a Jew. Similarly, whenever there is a possibility that the gentile will add more [on a Jew's behalf], [a Jew] should not benefit unless [the gentile] does not know [the Jew].17For then we may be certain that the gentile did not make an increase for the Jew's sake.

הלכה ד
אֲבָל דָּבָר שֶׁאֵין בּוֹ לְהַרְבּוֹת וּלְמַעֵט כְּגוֹן נֵר וְכֶבֶשׁ הוֹאִיל וְעָשָׂה בִּשְׁבִיל עַצְמוֹ נֶהֱנֶה אַחֲרָיו יִשְׂרָאֵל בְּשַׁבָּת וְאַף עַל פִּי שֶׁהוּא מַכִּירוֹ. נֵר הַדָּלוּק בִּמְסִבָּה בְּשַׁבָּת. אִם רֹב יִשְׂרָאֵל אָסוּר לְהִשְׁתַּמֵּשׁ לְאוֹרָהּ שֶׁהַמַּדְלִיק עַל דַּעַת הָרֹב מַדְלִיק. וְאִם רֹב נָכְרִים מֻתָּר לְהִשְׁתַּמֵּשׁ לְאוֹרָהּ. מֶחֱצָה לְמֶחֱצָה אָסוּר. נָפְלָה דְּלֵקָה בְּשַׁבָּת וּבָא נָכְרִי לְכַבּוֹת אֵין אוֹמְרִין לוֹ כַּבֵּה וְאַל תְּכַבֶּה מִפְּנֵי שֶׁאֵין שְׁבִיתָתוֹ עָלֵינוּ. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
4.
In contrast, when a matter concerns a situation where there is no concept of increasing or decreasing [one's efforts for the sake of the Jew] - e.g., a light or a ramp18Once a lamp is lit or a ramp is laid down, many people can benefit from it. No additional effort is required on their behalf. - since [the gentile] performed these activities for his own sake, a Jew may benefit from them afterwards on the Sabbath, even when [the gentile] knows him.
[The following laws apply when] a lamp is kindled at a gathering [of Jews and gentiles] on the Sabbath: If most of the people in attendance are Jewish, it is forbidden to benefit from the light, since the one who kindles it does so for the sake of the majority.19The Maggid Mishneh and the Shulchan Aruch (Orach Chayim 276:2) state that, even in such circumstances, if the gentile uses the light for the performance of a specific activity, it is clear that he kindled it for his own purposes. Hence, it is permitted for other Jews to benefit from it afterwards. If the majority are gentiles, it is permitted to benefit from the light. If the proportions are equal, it is forbidden.20The commentaries use this situation to exemplify the following principle: It is prohibited to benefit from the performance of a forbidden labor when it was performed for the sake of both a gentile and a Jew. (Note the Rambam's use of the expression "for his own sake alone" in Halachah 2).
Other commentaries (see Rashi, Shabbat 122a) offer different explanations for this ruling.
.
If a fire broke out on the Sabbath and a gentile comes to extinguish it, we may not tell him, "Extinguish it,21Although the situation may arouse fear, we are still forbidden to instruct a gentile specifically to perform a forbidden labor." nor [must we tell him,] "Do not extinguish it,"22Furthermore, as stated in Chapter 12, Halachah 7, one may say, "The person who extinguishes the fire will not suffer a loss," encouraging the gentile to do so.
From this law, Tosafot (Shabbat 122a) explains that a Jew is not obligated to prevent a gentile from carrying out a forbidden activity that benefits the Jew's property, if the gentile does so on his own initiative. The Shulchan Aruch (Orach Chayim 325:13) accepts this principle, provided that the gentile does not do this on a continuous basis.
for his resting is not our responsibility.23With this expression, the Rambam (quoting Shabbat 16:6) contrasts a gentile with one's children - even minors - and one's servants - even gentiles - for whom one is responsible that they rest on the Sabbath, as mentioned in Exodus 20:10. The same applies in all similar situations.

הלכה ה
מֵת שֶׁעָשׂוּ לוֹ נָכְרִים אָרוֹן וְחָפְרוּ לוֹ קֶבֶר בְּשַׁבָּת אוֹ הֵבִיאוּ לוֹ חֲלִילִין לִסְפֹּד בָּהֶן. אִם בְּצִנְעָה יַמְתִּין בִּכְדֵי שֶׁיֵּעָשׂוּ לְמוֹצָאֵי שַׁבָּת וְיִקָּבֵר בּוֹ. וְאִם הָיָה הַקֶּבֶר בִּסְרַטְיָא גְּדוֹלָה וְהָאָרוֹן עַל גַּבָּיו וְכָל הָעוֹבְרִין וְהַשָּׁבִין אוֹמְרִים שֶׁזֶּה שֶׁהַנָּכְרִים עוֹשִׂין עַכְשָׁו בְּשַׁבָּת לִפְלוֹנִי הוּא. הֲרֵי זֶה לֹא יִקָּבֵר בּוֹ אוֹתוֹ יִשְׂרָאֵל עוֹלָמִית. מִפְּנֵי שֶׁהוּא בְּפַרְהֶסְיָא. וּמֻתָּר לִקְבֹּר בּוֹ יִשְׂרָאֵל אַחֵר וְהוּא שֶׁיַּמְתִּין בִּכְדֵי שֶׁיֵּעָשֶׂה. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
5.
[The following principles apply when] gentiles make a coffin, dig a grave, or bring flutes to play mourning dirges on behalf of a deceased person:
If this was done discreetly, one must wait until that activity could have been carried out on Saturday night, and then the person may be buried using the above. If, however, the grave was located in a public square, the coffin was placed upon it, and all those who pass by say, "This activity that the gentiles are performing on the Sabbath is for the sake of so and so," that Jew may never be buried using the above, for this is a matter of public knowledge.24Even though a Jew did not instruct a gentile to perform any of these activities, since they were performed on behalf of a Jew in public, they may never be used on his behalf.
Another Jew, however, may be buried using the above, provided that the people wait the amount of time necessary for these activities to have been performed [after the Sabbath has concluded].25The Ra'avad objects to requiring one to wait when the product of the gentile's efforts is to be used for the sake of an individual other than the one for which they were originally intended. He explains that in Halachah 8, the Rambam states that this requirement was instituted, lest the person who benefits from the gentile's efforts instruct him to perform a forbidden labor. Needless to say, this does not apply in the situation under discussion, a burial.
The Shulchan Aruch (Orach Chayim 325:14) follows the Rambam's ruling. Although the rationale suggested by the Ra'avad is justifiable in this instance, the Rabbis did not accept it, in order to maintain a uniform policy regarding forbidden labor performed by a gentile on the Sabbath.
The same applies in all similar situations.

הלכה ו
נָכְרִי שֶׁהֵבִיא חֲלִילִין בְּשַׁבָּת לְמֵת אַף עַל פִּי שֶׁהֱבִיאָן מִצַּד הַחוֹמָה יַמְתִּין לְמוֹצָאֵי שַׁבָּת בִּכְדֵי שֶׁיָּבוֹא מִמָּקוֹם קָרוֹב וְאַחַר כָּךְ יִסְפְּדוּ בָּהֶן. שֶׁמָּא בַּלַּיְלָה הֱבִיאוּם מִמָּקוֹם אַחֵר עַד הַחוֹמָה וּבַבֹּקֶר נִכְנְסוּ בָּהֶן. וְאִם יָדַע בְּוַדַּאי שֶׁמִּמָּקוֹם פְּלוֹנִי הֱבִיאוּם בְּשַׁבָּת יַמְתִּין בִּכְדֵי שֶׁיָּבוֹאוּ מֵאוֹתוֹ מָקוֹם אַחַר הַשַּׁבָּת. וְהוּא שֶׁלֹּא יְהֵא הַדָּבָר בִּסְרַטְיָא גְּדוֹלָה כְּמוֹ שֶׁאָמַרְנוּ:
כסף משנה
6.
[The following rules apply when] a gentile brings flutes on the Sabbath to mourn a deceased person: Even though he brought them from just outside the wall,26In his Commentary on the Mishnah (Shabbat 23:4), the Rambam explains that if the flutes were brought from outside the city, they were brought from a public domain to a private domain. Hence, a transgression was involved, and it is necessary to wait for the time to pass that it would take to bring them after the conclusion of the Sabbath. We must, however, wait longer than the minimal amount of time it takes to bring them from outside the wall inside the wall, because of the suspicion mentioned by the Rambam. See also Hilchot Sh'vitat Yom Tov 2:10.
Significantly, Rashi (Shabbat 151a) and others interpret this Mishnah as relating to the prohibition against bringing objects from beyond the Sabbath boundary. The Shulchan Aruch (Orach Chayim 325:15-16) mentions both of these views.
we are required to wait the time it takes to bring them from a close place27Shulchan Aruch HaRav 325:22 and the Mishnah Berurah 325:76 explain this as referring to the Sabbath boundary - i.e., 2000 cubits. after the Sabbath has concluded, and afterwards we may mourn with them.28The Shulchan Aruch (loc. cit.:15) emphasizes that a more lenient ruling is given if the gentile did not bring the flutes through the public domain, and traveled via a carmelit instead. Since the gentile violated a Rabbinic prohibition and not a prohibition of the Torah itself, the flutes are permitted to be used immediately on Saturday night. [This restriction stems from our suspicion] that he brought them from another place at night, and then entered with them in the morning.
If one is certain that they were brought from another place on the Sabbath, one should wait [the amount of time] until it was possible to bring them from that place after [the conclusion of] the Sabbath.29This can lead to both a more lenient and a more stringent ruling. If the place was within the Sabbath limits, one is required to wait less time. If the place is beyond the Sabbath limits, one is required to wait longer (Shulchan Aruch HaRav 325:22 and the Mishnah Berurah 325:77). [The above leniencies apply] only when [the flutes were not brought] in a public square, as mentioned above.

הלכה ז
עִיר שֶׁיִּשְׂרָאֵל וְנָכְרִים דָּרִין בְּתוֹכָהּ וְהָיְתָה בָּהּ מֶרְחָץ הַמַּרְחֶצֶת בְּשַׁבָּת. אִם רֹב נָכְרִים מֻתָּר לִרְחֹץ בָּהּ לְמוֹצָאֵי שַׁבָּת מִיָּד. וְאִם רֹב יִשְׂרָאֵל יַמְתִּין בִּכְדֵי שֶׁיֵּחַמּוּ חַמִּין. שֶׁבִּשְׁבִיל הָרֹב הוּחַמּוּ. מֶחֱצָה לְמֶחֱצָה יַמְתִּין בִּכְדֵי שֶׁיֵּחַמּוּ חַמִּין. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
7.
[The following rules apply with regard to] a city inhabited by both Jews and gentiles that possesses a bathhouse that is open on the Sabbath: If the majority [of the bathers30This addition was made on the basis of the Mishnah Berurah 326:38, which explains that the ruling depends, not on the proportion of the population of the city at large, but on that of the bathers. Since they are the ones who use the bath, the bath is considered as being heated for them.] are gentiles, it is permitted to bathe in it on Saturday night immediately [after the conclusion of the Sabbath].
If the majority of the bathers are Jewish, one must wait [the time it takes] for the water to heat.31In his Commentary on the Mishnah (Machshirin 2:5-6, the source for his halachah), the Rambam expounds on the principle stated in the following halachah to explain why it is necessary to wait until the water could have heated. [The rationale is that] the water was heated for the majority of [the city's bathers]. If [the numbers of Jews and gentiles are] equal, one must wait [the time it takes] for the water to heat.32In this instance, it is considered as if the baths were heated for the sake of both the Jews and the gentiles, as explained in the notes to Halachah 4. The same applies in all similar situations.

הלכה ח
יִשְׂרָאֵל שֶׁאָמַר לְנָכְרִי לַעֲשׂוֹת לוֹ מְלָאכָה זוֹ בְּשַׁבָּת אַף עַל פִּי שֶׁעָבַר וּמַכִּין אוֹתוֹ מַכַּת מַרְדּוּת מֻתָּר לוֹ לֵהָנוֹת בְּאוֹתָהּ מְלָאכָה לָעֶרֶב אַחַר שֶׁיַּמְתִּין בִּכְדֵי שֶׁתֵּעָשֶׂה. וְלֹא אָסְרוּ בְּכָל מָקוֹם עַד שֶׁיַּמְתִּין בִּכְדֵי שֶׁיֵּעָשׂוּ אֶלָּא מִפְּנֵי דָּבָר זֶה. שֶׁאִם תֹּאמַר יְהֵא מֻתָּר מִיָּד שֶׁמָּא יֹאמַר לְנָכְרִי לַעֲשׂוֹת לוֹ וְיִמְצָא הַדָּבָר מוּכָן מִיָּד. וְכֵיוָן שֶׁאָסְרוּ עַד שֶׁיַּמְתִּין בִּכְדֵי שֶׁיֵּעָשׂוּ לֹא יֹאמַר לְנָכְרִי לַעֲשׂוֹת לוֹ שֶׁהֲרֵי אֵינוֹ מִשְׂתַּכֵּר כְּלוּם מִפְּנֵי שֶׁהוּא מִתְעַכֵּב לָעֶרֶב בִּכְדֵי שֶׁיֵּעָשֶׂה דָּבָר זֶה שֶׁנַּעֲשָׂה בְּשַׁבָּת:
כסף משנה
8.
A Jew who instructs a gentile to perform a [forbidden] labor on his behalf on the Sabbath commits a transgression and should be given stripes for rebellion33The punishment given for the violation of Rabbinic prohibitions. [as punishment]. Nevertheless, he is permitted to benefit from the labor on Saturday night after waiting the time it takes for the labor to have been performed.34Although Rabbenu Yerucham forbids ever benefiting from such work, the Shulchan Aruch (Orach Chayim 307:20) accepts the Rambam's ruling.
The following is the sole reason35This appears to differ from Rashi's interpretation (Beitzah 24b), which explains (with regard to the festivals) that the reason that one is required to wait until the time it takes to perform the forbidden labor after the festival passes is "so that one will not benefit from a [forbidden] labor performed on a festival." Seemingly, he would accept the same rationale with regard to the Sabbath. for which [the Sages] forbade using [the products of forbidden labor] until the time to perform the labor passes on Saturday night: If one permitted the use of [the products of forbidden labor] immediately [on Saturday night], a person might tell a gentile to perform a [forbidden] labor on his behalf, so that [after the conclusion of the Sabbath], it will be immediately available for him. Since, however, [the products of forbidden labor] are forbidden until the time it takes for the labor to have been performed passes, he will not instruct a gentile to perform this task. It does not bring him any benefit at all, for on Saturday evening he must wait the time it takes for the labor to have been performed on the Sabbath.

הלכה ט
דָּבָר שֶׁאֵינוֹ מְלָאכָה וְאֵין אָסוּר לַעֲשׂוֹתוֹ בְּשַׁבָּת אֶלָּא מִשּׁוּם שְׁבוּת מֻתָּר לְיִשְׂרָאֵל לוֹמַר לְנָכְרִי לַעֲשׂוֹתוֹ בְּשַׁבָּת. וְהוּא שֶׁיִּהְיֶה שָׁם מִקְצָת חלִי אוֹ יִהְיֶה צָרִיךְ לַדָּבָר צֹרֶךְ הַרְבֵּה אוֹ מִפְּנֵי מִצְוָה:
כסף משנה
9.
A Jew is permitted to instruct a gentile to perform an activity that is not a [forbidden] labor36The Rambam derives this principle from Eruvin 67b, which mentions that one is permitted to instruct a gentile to bring hot water to wash a child after circumcision, provided he does not have to pass through the public domain. The Rambam maintains that one can extrapolate from this instance to other similar cases. Although Tosafot, Gittin 8b, differs, the Rambam's opinion is accepted by the Shulchan Orach (Orach Chayim 307:5) as well as the later Ashkenazic authorities (Shulchan Aruch HaRav 307:12, Mishnah Berurah 307:23).
The Ramah (Orach Chayim 276:2) states that there are authorities who allow one to instruct a gentile to perform a forbidden labor on the Sabbath so that a mitzvah can be performed. Although he does not accept this opinion, he allows for leniency in circumstances of great necessity.
and is prohibited from being performed on the Sabbath only as a sh'vut.37In Chapter 21, Halachah 1, the Rambam defines sh'vut as an activity forbidden by the Sages because it resembles a forbidden labor or because it might lead to the performance of a forbidden labor.
The rationale behind this leniency is the principle that a Rabbinic prohibition is not instituted to support another Rabbinic prohibition. Since the activity in question is merely a Rabbinic prohibition, and the prohibition against instructing a gentile to perform a forbidden activity on the Sabbath is Rabbinic in origin, the two Rabbinic prohibitions should not be associated.
[This leniency applies] provided that this is necessary because of a minor infirmity,38In contrast to the situations mentioned in Chapter 2, here the Rambam is not speaking of a situation where the person is dangerously ill or even when there is a danger threatening one of the limbs of his body. Instead, the intent is situations that involve minor discomfort. Although a Jew himself is forbidden to perform certain activities that would relieve this uneasiness, a gentile is allowed to do so. a very pressing matter,39Shulchan Aruch HaRav, loc. cit., cites as an example of this principle, merchandise that would spoil if left in the rain. [See the Shulchan Aruch (Orach Chayim 307:19) and commentaries.]
4 0. See Hilchot Milah 2:9. Significantly, Shulchan Aruch HaRav 331:7 and the Mishnah Berurah 331:22 rely on the leniency mentioned by the Ramah cited in note 36 in this instance. Since the circumcision itself involves carrying out a forbidden labor on the Sabbath, other labors that are necessary for the mitzvah to be performed may be carried out by a gentile even when instructed by a Jew.
or a mitzvah.

הלכה י
כֵּיצַד. אוֹמֵר יִשְׂרָאֵל לְנָכְרִי בְּשַׁבָּת לַעֲלוֹת בָּאִילָן אוֹ לָשׁוּט עַל פְּנֵי הַמַּיִם כְּדֵי לְהָבִיא לוֹ שׁוֹפָר. אוֹ סַכִּין לְמִילָה. אוֹ מֵבִיא לוֹ מֵחָצֵר לְחָצֵר שֶׁאֵין עֵרוּב בֵּינֵיהֶן מַיִם חַמִּין לְהַרְחִיץ בָּהֶם קָטָן וּמִצְטַעֵר. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
10.
What is implied? On the Sabbath, a Jew may instruct a gentile to climb a tree or to swim across water to bring him a shofar or a knife for circumcision. Similarly, [one may instruct a gentile] to bring hot water from one courtyard to another to wash a child or a person experiencing difficulty,40As stated above, Eruvin 67b mentions this instance with regard to circumcision. As explained above, the Rambam extends the leniency beyond the specific instance and applies it to other similar circumstances. although an eruv was not made to join them.41Carrying in courtyards with an eruv is discussed in Chapters 16 and 17. The same applies in all similar situations.

הלכה יא
הַלּוֹקֵחַ בַּיִת בְּאֶרֶץ יִשְׂרָאֵל מִן הַנָּכְרִי מֻתָּר לוֹ לוֹמַר לַנָּכְרִי לִכְתֹּב לוֹ שְׁטָר בְּשַׁבָּת. שֶׁאֲמִירָה לְנָכְרִי בְּשַׁבָּת אֲסוּרָה מִדִּבְרֵיהֶם וּמִשּׁוּם יִשּׁוּב אֶרֶץ יִשְׂרָאֵל לֹא גָּזְרוּ בְּדָבָר זֶה. וְכֵן הַלּוֹקֵחַ בַּיִת מֵהֶם בְּסוּרְיָא, שֶׁסּוּרְיָא כְּאֶרֶץ יִשְׂרָאֵל לְדָבָר זֶה:
כסף משנה
11.
When a person buys a house in Eretz Yisrael from a gentile,42The Magen Avraham 306:19-20 cites other authorities who state that a Jew should not complete the sale on the Sabbath. Even according to the Rambam, it appears that one is forbidden to give the gentile money on the Sabbath. he is permitted to tell the gentile to compose a deed of sale on the Sabbath.43From the fact that this law is cited in the Shulchan Aruch (Orach Chayim 306:11), it is clear that it applies in the present era as well. Giving the gentile instructions [to perform a forbidden labor on the Sabbath] is a Rabbinic prohibition, and because [of the importance] of settling Eretz Yisrael44In contrast to the Ramban, the Rambam does not consider the settlement of Eretz Yisrael as one of the 613 mitzvot of the Torah. There is, however, no question of the great importance he attaches to this activity. (See Hilchot Melachim, 5:9-12. See also Hilchot Avodat Kochavim 10:3-4.)the Sages did not enforce their decree in this instance.
Similarly, the above principles apply when one purchases a house from [a gentile] in Syria, for Syria is equivalent to Eretz Yisrael in this regard.45In Hilchot Terumah 1:2-3, the Rambam defines Syria as the lands outside Eretz Yisrael conquered by King David. Generally, lands conquered by the entire Jewish people are included in Eretz Yisrael. In this instance, however, although David was a king and his wars were approved by the Sanhedrin, these lands did not become part of Eretz Yisrael, because he had not completed the conquest of all the lands of the Canaanite nations at that time. Nevertheless, because of the communal nature of his conquest, the Rabbis ordained that certain of the laws applicable within Eretz Yisrael should also apply there. Compare also to Hilchot Avodat Kochavim 10:3.

הלכה יב
פּוֹסֵק אָדָם עִם הַנָּכְרִי עַל הַמְּלָאכָה וְקוֹצֵץ דָּמִים וְהַנָּכְרִי עוֹשֶׂה לְעַצְמוֹ וְאַף עַל פִּי שֶׁהוּא עוֹשֶׂה בְּשַׁבָּת מֻתָּר. וְכֵן הַשּׂוֹכֵר אֶת הַנָּכְרִי לְיָמִים הַרְבֵּה מֻתָּר אַף עַל פִּי שֶׁהוּא עוֹשֶׂה בְּשַׁבָּת. כֵּיצַד. כְּגוֹן שֶׁשָּׂכַר הַנָּכְרִי לְשָׁנָה אוֹ לִשְׁתַּיִם שֶׁיִּכְתֹּב לוֹ אוֹ שֶׁיֶּאֱרֹג לוֹ. הֲרֵי זֶה כּוֹתֵב וְאוֹרֵג בְּשַׁבָּת וּמֻתָּר כְּאִלּוּ קָצַץ עִמּוֹ שֶׁיִּכְתֹּב לוֹ סֵפֶר אוֹ שֶׁיֶּאֱרֹג לוֹ בֶּגֶד שֶׁהוּא עוֹשֶׂה בְּכָל עֵת שֶׁיִּרְצֶה. וְהוּא שֶׁלֹּא יַחְשֹׁב עִמּוֹ יוֹם יוֹם:
כסף משנה
12.
When a person contracts a gentile for a task and sets the price, the gentile [is considered] as acting in his own interests.46Since the gentile contractor has established a set price for his work, it does not matter when he performs the labor involved. Accordingly, he is considered as working for himself and not on behalf of the Jew.
The Rashba emphasizes that this leniency applies only when the gentile performs the task in question on his own premises. If he does so on premises belonging to a Jew, it is forbidden for him to work on the Sabbath even when the price is set beforehand. The Shulchan Aruch (Orach Chayim 244:5, 252:2) quotes the Rashba's view.
[Therefore,] even if he performs the task on the Sabbath, it is permitted.47The Jew may not, however, explicitly tell the gentile to perform a forbidden labor on the Sabbath even if he is hired on a contractual basis (Shulchan Aruch, loc. cit. 252:2). Similarly, it is permissible to hire a gentile for a prolonged period, although he performs [forbidden] labor on the Sabbath.48The Rambam's decision is based on Mo'ed Katan 12a, which mentions a person hired on a weekly, monthly, or yearly basis - i.e., rather than receive a wage on an hourly basis, he is contracted to perform a particular task which his employer will present him from time to time.
The Ra'avad differs with the Rambam on this issue, maintaining that although a person who is hired on a weekly basis is not required to work on the Sabbath, the Jew receives a direct benefit from the fact that he does. Therefore, this is forbidden.
The Shulchan Aruch (loc. cit. 244:5) accepts the Rambam's view. The Turei Zahav 244:5 emphasizes, however, that this ruling may be accepted only when the employer does not mind if the gentile does not work at any specific time. If he requires him to work a set number of hours, this is not acceptable.
(To explain the concept in contemporary terms: An employee who receives a weekly salary for a specific time commitment is not covered by this leniency. In contrast, an outside professional who is hired on a retainer basis is, for he is not bound by a time commitment to the employer.)
The Noda BiY'hudah (Orach Chayim, Vol. II, Responsum 38) explains the difference between the Rambam's and the Ra'avad's view as follows: In the case of a contractor, the gentile is the one who benefits from his working on the Sabbath. Although he is not obligated to work then, by doing so he earns a fee that he would not have received otherwise.
In contrast, when an employee is paid on a retainer basis, he receives no benefit from working on the Sabbath, for he receives the same wage regardless. Therefore, the Ra'avad considers this to be forbidden. The Rambam, however, permits this, since the employer receives no additional profit from the task being completed on the Sabbath. Were it not to be completed then, it would have been completed on the following day.

What is implied? When a person hires a gentile for a year or two as a scribe or as a weaver,49The Ramah (loc. cit.) emphasizes that if the gentile is hired as a jack of all trades, it is forbidden for him to work on the Sabbath. In such an instance, the Jew has a distinct benefit from his working on the Sabbath, since there will surely be other work for him to do on the following day. it is permissible for the gentile to write or weave on the Sabbath. It is as though he contracted him to write a scroll or weave a garment, [in which case, he may] perform the task whenever he desires. [This leniency is granted] provided he does not pay him on a day to day basis.50In such an instance, the wage the gentile receives for the work performed on the Sabbath is distinct. Hence, it is forbidden.

הלכה יג
בַּמֶּה דְּבָרִים אֲמוּרִים בְּצִנְעָה שֶׁאֵין מַכִּירִים הַכּל שֶׁזּוֹ הַמְּלָאכָה הַנַּעֲשֵׂית בְּשַׁבָּת שֶׁל יִשְׂרָאֵל הִיא. אֲבָל אִם הָיְתָה יְדוּעָה וּגְלוּיָה וּמְפֻרְסֶמֶת אֲסוּרָה שֶׁהָרוֹאֶה אֶת הַנָּכְרִי עוֹסֵק אֵינוֹ יוֹדֵעַ שֶׁקָּצַץ וְאוֹמֵר שֶׁפְּלוֹנִי שָׂכַר הַנָּכְרִי לַעֲשׂוֹת לוֹ מְלָאכָה בְּשַׁבָּת:
כסף משנה
13.
When does the above51This restriction applies both to the leniency allowing a gentile to work as a contractor and to that which allows him to work on a retainer basis. apply? When the matter is discreet, and everyone52The Magen Avraham 244:2 states that this wording implies that if several individuals know that the task is being performed for the sake of a Jew, but the matter is not public knowledge, there is no prohibition involved. is not aware that the [forbidden] labor being performed on the Sabbath is for the sake of a Jew. If, however, it53It is of no importance to us whether people see the work being performed or not. What is significant is that they know that this work is being performed for the sake of a Jew (Rabbenu Yerucham). is a matter that is well known, open, and of public knowledge,54"Public knowledge" refers to matters known within the Jewish community. As reflected by the following halachah, if the matter is known to gentiles but not to Jews, there is no difficulty. it is forbidden [for a gentile to perform such work]. A person who sees the gentile working does not know that he has been hired on a contractual55See Hilchot Sh'vitat Yom Tov 7:25, which states "People at large do not know the difference between a contractor and a hired worker. Hence, it is forbidden."
Note also the Be'ur Halachah 244, which questions whether a gentile is permitted to perform work on behalf of a Jew if it is common custom for these tasks to be performed by a contractor. In such a situation, it is unlikely that an observer would assume that the gentile was hired to work on a daily basis. Nevertheless, as mentioned in the Mishnah Berurah 244:7, the Noda BiY'hudah (Orach Chayim, Vol. I, Responsum 12), and Shulchan Aruch HaRav 244:8, the common custom is to allow such work to be performed.
basis and will say that so and so56From the wording the Rambam uses, one might infer that this restriction applies to a private individual. In contrast, if a community at large employs a gentile, it can be assumed that they hired him in a permitted manner. On this basis, there are opinions which allow a gentile contractor to perform services for the community on the Sabbath (Magen Avraham 244:8). hired a gentile to work for him on the Sabbath.

הלכה יד
לְפִיכָךְ הַפּוֹסֵק עִם הַנָּכְרִי לִבְנוֹת לוֹ חֲצֵרוֹ אוֹ כָּתְלוֹ אוֹ לִקְצֹר אֶת שָׂדֵהוּ אוֹ שֶׁשְּׂכָרוֹ שָׁנָה אוֹ שְׁתַּיִם לִבְנוֹת לוֹ חָצֵר אוֹ לִטַּע לוֹ כֶּרֶם. אִם הָיְתָה הַמְּלָאכָה בַּמְּדִינָה אוֹ בְּתוֹךְ הַתְּחוּם אָסוּר לוֹ לַהֲנִיחָן לַעֲשׂוֹת בְּשַׁבָּת מִפְּנֵי הָרוֹאִים שֶׁאֵינָם יוֹדְעִים שֶׁפָּסַק. וְאִם הָיְתָה הַמְּלָאכָה חוּץ לַתְּחוּם מֻתָּר שֶׁאֵין שָׁם יִשְׂרָאֵל שֶׁיִּרְאֶה אֶת הַפּוֹעֲלִין כְּשֶׁהֵן עוֹשִׂין בְּשַׁבָּת:
כסף משנה
14.
Therefore, [the following rules apply when] a person hires a gentile to build a courtyard or a wall or to harvest his field, or [hires him to work] at building his courtyard or planting a vineyard for him for a year or two:
If the project is located in a city57I.e., either the city in which the Jew contracting the gentile lives or another city populated by Jews. or within its Sabbath limits, it is forbidden for the Jew to allow them to work on the Sabbath,58Note the Shulchan Aruch (Orach Chayim 244:3), which states that if a gentile builds a house for a Jew on the Sabbath, it is proper not to enter it. because of [the impression this might create in the mind of] an observer who is unaware that they were hired on a contractual basis. If the project is located beyond the Sabbath limits, it is permitted, for there are no Jews who will see the laborers at work on the Sabbath.

הלכה טו
וְכֵן מֻתָּר לְאָדָם לְהַשְׂכִּיר כַּרְמוֹ אוֹ שָׂדֵהוּ לְנָכְרִי אַף עַל פִּי שֶׁהוּא זוֹרְעָן וְנוֹטְעָן בְּשַׁבָּת. שֶׁהָרוֹאֶה יוֹדֵעַ שֶׁשְּׂכוּרִין הֵן אוֹ בַּאֲרִיסוּת נָתַן לָהֶן. וְדָבָר שֶׁשֵּׁם יִשְׂרָאֵל בְּעָלָיו קָרוּי עָלָיו וְאֵין דֶּרֶךְ רֹב אַנְשֵׁי אוֹתוֹ הַמָּקוֹם לְהַשְׂכִּירוֹ אוֹ לִתְּנוֹ בַּאֲרִיסוּת אָסוּר לְהַשְׂכִּירוֹ לְנָכְרִי. מִפְּנֵי שֶׁהַנָּכְרִי עוֹשֶׂה בְּאוֹתוֹ הַמָּקוֹם מְלָאכָה בְּשַׁבָּת וְהוּא נִקְרָא עַל שֵׁם הַיִּשְׂרָאֵל בְּעָלָיו:
כסף משנה
15.
Similarly, it is permitted for a Jew to hire out his vineyard or his field to a gentile, although the latter will sow and plant them on the Sabbath, since an observer will know that they have been hired out or given [to the gentile] under a sharecropping agreement.59Since these arrangements are commonplace, an observer will not think that the gentile was employed as a hired worker.
[In contrast,] when an enterprise60The Shulchan Aruch (Orach Chayim 243:1) gives as examples a bathhouse or an oven. As explained in the following note, the inclusion of an enterprise in this category is dependent on the business practices common in that locale. is known by the name of its Jewish owner and is not of the type that is hired out or contracted out under a profit sharing agreement by most people in that city, it is forbidden to be hired out to a gentile.61I.e., since the gentile will operate the enterprise on the Sabbath, it is forbidden to rent him the enterprise even on an annual or monthly basis.
As the Rambam mentions in his Commentary on the Mishnah (Avodah Zarah 1:8, the source for this halachah), the determination of which enterprises are included in this category is dependent on the local business practices. If it is commonplace for an enterprise to be rented out on an annual or monthly basis, an onlooker will not suppose that the gentile operating the enterprise is working for the Jew as a hired hand. (See also Shulchan Aruch, loc. cit.:2.)
The gentile will perform work in the establishment on the Sabbath, and [in the public's mind, the establishment] will be associated with the name of its Jewish owner.62Similarly, if it is publicized throughout the community that the enterprise has been hired to the gentile, there is no prohibition. (See Shulchan Aruch, loc. cit..)

הלכה טז
מֻתָּר לְהַשְׁאִיל כֵּלִים וּלְהַשְׂכִּירָן לְנָכְרִי וְאַף עַל פִּי שֶׁהוּא עוֹשֶׂה בָּהֶן מְלָאכָה בְּשַׁבָּת מִפְּנֵי שֶׁאֵין אָנוּ מְצֻוִּים עַל שְׁבִיתַת הַכֵּלִים. אֲבָל בְּהֶמְתּוֹ וְעַבְדּוֹ אָסוּר מִפְּנֵי שֶׁאָנוּ מְצֻוִּין עַל שְׁבִיתַת בְּהֵמָה וְעֶבֶד:
כסף משנה
16.
It is permitted to lend63One may not, however, lend a utensil to a gentile on the Sabbath itself. Similarly, when a utensil is lent on Friday, the gentile must have time to bring it out of the Jew's premises before the commencement of the Sabbath [Halachah 19, Shulchan Aruch (Orach Chayim 246:2)]. and hire out64The Shulchan Aruch (loc. cit.:1) states that if a Jew receives payment for the Sabbath day, he must arrange to be paid on a weekly or monthly basis. It is forbidden to receive payment for the Sabbath as a distinct entity. utensils to a gentile although he will perform [forbidden] labors with them on the Sabbath,65The Ra'avad, based on his interpretation of Shabbat 19a, states that it is forbidden to rent an article to a gentile on Friday, since it will appear that one is receiving a wage for the Sabbath. The Maggid Mishneh justifies the Rambam's decision, explaining that according to the Rambam, the passage the Ra'avad cites follows the opinion of the School of Shammai, which is not accepted as halachah.
The Shulchan Aruch (Orach Chayim 246:1) mentions both opinions, and the Ramah states that it is customary to follow the Ra'avad's ruling.
for we are not obligated to have our utensils rest [on the Sabbath].66Note the application of this principle in the first halachot of Chapter 3. It is, however, forbidden to [lend or hire out] one's servant or livestock67See Chapter 20, Halachah 1, which includes fowl, fish, and all other living beings in this prohibition. [to work on the Sabbath], for we are commanded that they rest.68Exodus 20:10 states "You shall not perform any labor, neither you, your son, your daughter, your servant, your maid-servant, or your beast." See also Exodus 23:12 and other sources. The nature of this p rohibition is discussed in Chapter 20.

הלכה יז
הַמִּשְׁתַּתֵּף עִם הַנָּכְרִי בִּמְלָאכָה אוֹ בִּסְחוֹרָה אוֹ בַּחֲנוּת. אִם הִתְנוּ בַּתְּחִלָּה שֶׁיִּהְיֶה שְׂכַר הַשַּׁבָּת לַנָּכְרִי לְבַדּוֹ אִם מְעַט אִם הַרְבֵּה וּשְׂכַר יוֹם אַחֵר כְּנֶגֶד יוֹם הַשַּׁבָּת לְיִשְׂרָאֵל לְבַדּוֹ מֻתָּר. וְאִם לֹא הִתְנוּ בַּתְּחִלָּה. כְּשֶׁיָּבוֹאוּ לַחֲלֹק נוֹטֵל הַנָּכְרִי שְׂכַר הַשַּׁבָּתוֹת כֻּלָּן לְבַדּוֹ וְהַשְּׁאָר חוֹלְקִין אוֹתוֹ. וְאֵינוֹ מוֹסִיף לוֹ כְּלוּם כְּנֶגֶד יוֹם הַשַּׁבָּת אֶלָּא אִם כֵּן הִתְנוּ בַּתְּחִלָּה. וְכֵן אִם קִבְּלוּ שָׂדֶה בְּשֻׁתָּפוּת דִּין אֶחָד הוּא:
כסף משנה
17.
[The following rules apply when a Jew] enters into a partnership with a gentile concerning labor, merchandise, or the operation of a storefront:69In such a situation, although the Jew does not work on the Sabbath, if he benefited from his gentile partner's activity, the latter would be considered to be acting as his agent unless they make a stipulation clarifying the matter at the outset. If such a stipulation was made at the outset,70"At the outset" means when the partnership was originally established. If such an agreement was not made at that time, and the Jew made such an offer to the gentile afterwards, there are difficulties, for it appears that the Jew is paying the gentile for working on the Sabbath by working one day in the middle of the week. it is permissible71This leniency is not granted merely after the fact. On the contrary, it is a perfectly acceptable course of action according to Jewish law (Ba'er Heteiv 245:1). for the profits from the Sabbath - whether large or small - to be designated for the gentile alone, and the profits of another day to be given to the Jew alone in exchange.72Rabbenu Nissim emphasizes that the need for such a stipulation applies only in situations where one of the partners works one day and the other another day. If during the week both work together, the fact that the gentile works on the Sabbath does not cause the profits of that day to be forbidden for the Jew. The gentile knows that the Jew will not work on the Sabbath, nor will he work any more during the week. Therefore, the activity the gentile is performing is motivated by his own benefit. The fact that he gives a share to the Jew as well is of no consequence. The Ramah accepts this ruling (Orach Chayim 245:1).
If, however, such conditions were not made at the outset, when [the two] come to divide the profits, the gentile should take all the profits of the Sabbath for himself alone, and then the remainder should be divided [equally].73Avodah Zarah 22a does not make a final ruling in this situation, and the Rambam follows the more stringent position. (Note a similar ruling, Hilchot Ma'achalot Asurot 10:14.)
In contrast, Rabbenu Asher states that in such a situation, if the gentile willingly gives the Jew a share of the Sabbath profits, the Jew is allowed to keep it. The Ramah (loc. cit.) states that after the fact, one may rely on this ruling. The Shulchan Aruch HaRav 245:2 rules more stringently and states that one may rely on Rabbenu Asher's opinion only in the case of a major loss.
The [gentile] need not give [the Jew] anything extra for the Sabbath unless a stipulation to that effect was made at the outset.74The Shulchan Aruch (Orach Chayim 245:3) describes the procedure to follow when a Jew and gentile partner did not make such an agreement at the beginning of the partnership, and the Jew desires to do so afterwards. The same principles apply if [a Jew and a gentile] hired a field under a partnership arrangement.75Significantly, the Magen Avraham 245:1 differentiates between a field that requires work seven days a week and certain business establishments that do not require active effort on the part of their owner. For example, partners may own an oven and rent it out to others.
In the first instance, when the gentile works on the Sabbath, he appears to be working as the agent of the Jew. In the latter instance, by contrast, since there is no work required on the Sabbath, the gentile partner appears to be acting in his own interest by renting the establishment to others. Therefore, the Jew is allowed to receive a share of the profits.

הלכה יח
וְאִם לֹא הִתְּנוּ וּבָאוּ לַחֲלֹק הַשָּׂכָר וְלֹא הָיָה שְׂכַר שַׁבָּת יָדוּעַ יֵרָאֶה לִי שֶׁהַנָּכְרִי נוֹטֵל לְבַדּוֹ שְׁבִיעִית הַשָּׂכָר וְהַשְּׁאָר חוֹלְקִין. הַנּוֹתֵן מָעוֹת לְנָכְרִי לְהִתְעַסֵּק בָּהֶן אַף עַל פִּי שֶׁהַנָּכְרִי נוֹשֵׂא וְנוֹתֵן בְּשַׁבָּת חוֹלֵק עִמּוֹ בַּשָּׂכָר בְּשָׁוֶה וְכֵן הוֹרוּ כָּל הַגְּאוֹנִים:
כסף משנה
18.
If the stipulation [mentioned above] was not made, [the partners] came to divide the profits, and the profits of the Sabbath were not distinct, it appears to me76This expression implies a ruling made by the Rambam that is not based on a previous Rabbinic source. that the gentile should take a seventh of the profits alone77Thus, retroactively the Jew renounces his portion in the gentile's activity. Hence, the gentile is no longer considered to be acting as his agent (Shulchan Aruch HaRav 245:6). and the remainder should be divided equally.78The Shulchan Aruch (Orach Chayim 245:1) accepts the Rambam's ruling. As mentioned, in a case of severe loss, the Ramah allows leniency in accordance with the opinion of Rabbenu Asher mentioned in note 74.
When a person gives a gentile money to invest, the two may divide the profits equally, despite the fact that the gentile engages in business dealings with these funds on the Sabbath.79In this instance, the Jew is not obligated to perform work at all. Hence, no one will say that the gentile is working as the Jew's agent (Shulchan Aruch, loc. cit.:4). Furthermore, the gentile is not obligated to work on the Sabbath. Should he choose to do so, it is his own independent decision, which is not at all related to the Jew (Shulchan Aruch HaRav 245:16). All of the Geonim80The Beit Yosef (Orach Chayim 245) cites a responsum of Rav Sherirah Gaon. (See also Teshuvat HaGeonim, Responsum 43.) concur with this ruling.

הלכה יט
לֹא יִתֵּן אָדָם בְּעֶרֶב שַׁבָּת כֵּלִים לְאֻמָּן נָכְרִי לַעֲשׂוֹתָן אַף עַל פִּי שֶׁפָּסַק עִמּוֹ. אֶלָּא בִּכְדֵי שֶׁיֵּצֵא בָּהֶן מִבֵּיתוֹ קֹדֶם שֶׁחֲשֵׁכָה. וְכֵן לֹא יִמְכֹּר אָדָם חֲפָצָיו לְנָכְרִי וְלֹא יַשְׁאִילֶנּוּ וְלֹא יַלְוֶנּוּ וְלֹא יְמַשְׁכְּנֶנּוּ וְלֹא יִתֵּן לוֹ בְּמַתָּנָה אֶלָּא בִּכְדֵי שֶׁיֵּצֵא בְּאוֹתוֹ חֵפֶץ מִפֶּתַח בֵּיתוֹ קֹדֶם הַשַּׁבָּת. שֶׁכָּל זְמַן שֶׁהוּא בְּבֵיתוֹ אֵין אָדָם יוֹדֵעַ אֵימָתַי נָתַן לוֹ וּכְשֶׁיֵּצֵא הַנָּכְרִי מִבֵּיתוֹ בְּשַׁבָּת וְחֵפֶץ יִשְׂרָאֵל בְּיָדוֹ יֵרָאֶה כְּמִי שֶׁהִלְּוָהוּ לַנָּכְרִי אוֹ מִשְׁכְּנוֹ אוֹ פָּסַק עִמּוֹ אוֹ מָכַר לוֹ בְּשַׁבָּת:
כסף משנה
19.
A Jew should not give utensils to a gentile artisan to fashion81Or to fix, improve, or work on in any way. on Friday, despite the fact that he has established a set price,82Once a set price is established, there is no difficulty with the gentile's working on the utensil on the Sabbath. Since the same price would be paid whether the work is done on Saturday or another day, the gentile is considered to be working for himself if he decides to work on the Sabbath. Nevertheless, even though basis of the contractual arrangement is correct, this is forbidden, since the article was given to the gentile directly before the commencement of the Sabbath. unless there is time for him to remove them from [the Jew's] home before nightfall.83I.e., before the commencement of the Sabbath. Were the gentile to take the article from the Jew's home on the Sabbath, it would appear that he was working for him, as the Rambam states at the conclusion of this halachah.
Similarly, a person should not sell, lend, pawn, or give a present of his possessions to a gentile unless [the gentile] can leave the entrance of [the Jew's] house with that article before the Sabbath. As long as [the gentile] is in [the Jew's] house, no one knows when he gave it to him. Thus, should the gentile leave [the Jew's] house on the Sabbath with [the Jew's] possessions in his hand, it would appear that the object was lent, pawned, agreed to be worked on, or sold on the Sabbath.84As mentioned in Chapter 23, Halachah 12, these business transactions are forbidden on the Sabbath.

הלכה כ
הַנּוֹתֵן אִגֶּרֶת לְנָכְרִי לְהוֹלִיכָהּ לְעִיר אַחֶרֶת אִם קָצַץ עִמּוֹ שְׂכַר הוֹלָכָה מֻתָּר. וַאֲפִלּוּ נְתָנָהּ לוֹ עֶרֶב שַׁבָּת עִם חֲשֵׁכָה. וְהוּא שֶׁיֵּצֵא בָּהּ מִפֶּתַח בֵּיתוֹ קֹדֶם הַשַּׁבָּת. וְאִם לֹא קָצַץ אִם יֵשׁ בַּמְּדִינָה אָדָם קָבוּעַ שֶׁהוּא מְקַבֵּץ הָאִגְּרוֹת וְשׁוֹלֵחַ אוֹתָם לְכָל מְדִינָה וּמְדִינָה עִם שְׁלוּחָיו מֻתָּר לִתֵּן לַנָּכְרִי הָאִגֶּרֶת. וְהוּא שֶׁיִּהְיֶה שְׁהוּת בַּיּוֹם כְּדֵי שֶׁיַּגִּיעַ לַבַּיִת הַסָּמוּךְ לַחוֹמָה קֹדֶם הַשַּׁבָּת. שֶׁמָּא זֶה שֶׁמְּקַבֵּל הָאִגְּרוֹת וְשׁוֹלְחָן בֵּיתוֹ סָמוּךְ לַחוֹמָה הוּא. וְאִם אֵין שָׁם אָדָם קָבוּעַ לְכָךְ אֶלָּא הַנָּכְרִי שֶׁנּוֹתְנִין לוֹ הָאִגֶּרֶת הוּא שֶׁמּוֹלִיכָהּ לְעִיר אַחֶרֶת אָסוּר לִשְׁלֹחַ בְּיַד נָכְרִי הָאִגֶּרֶת לְעוֹלָם אֶלָּא אִם כֵּן קָצַץ לוֹ דָּמִים:
כסף משנה
20.
[The following rules apply when] a person gives a gentile a letter to bring to another city. If he fixed a fee for conveying [the letter], it is permitted [even if the gentile conveys it on the Sabbath].85The Shulchan Aruch (Orach Chayim 247:1) emphasizes that one may not specify that the gentile should convey the article on the Sabbath. [This leniency applies] even when [the Jew] gives [the letter] to [the gentile] on Friday at nightfall, provided [the gentile] leaves [the Jew's] home before the commencement of the Sabbath.
When a fee was not fixed [beforehand, the following rules apply]: If there is a designated person in the city86We have translated both the words and as "city," since in other sources (see Hilchot Megillah, Chapter 1) we find them both used by the Rambam with that meaning. (More particularly, refers to a small city, while to a large metropolis.)
The Kessef Mishneh, however, interprets as referring to a province, and thus explains the halachah as referring to an instance where the person charged with conveying the letter travels from his city to another place.
who collects letters and sends them to other cities with his agents,87I.e., a post office. Since the post office charges fixed prices for its services, there is no difficulty in having it convey mail on the Sabbath. Accordingly, there is no difficulty at present in sending mail before the Sabbath. On the Sabbath itself, however, it is forbidden to send mail, even by means of the post office. it is permitted to give a gentile the letter,88I.e., this gentile does not bring the letter to its destination, but merely brings it to the post office. Nevertheless, since a fee has not been established for his services in bringing the letter to the post office, there must be enough time for him to do so before the commencement of the Sabbath. Otherwise, it would appear that he is acting as the Jew's agent. provided there is time [on Friday] for the letter to reach a house adjacent to [the city's] wall before [the commencement of] the Sabbath, lest the home of the gentile who collects and sends letters be located there.89The Rambam is referring to an instance where the gentile bringing the letter to the post office does not know the location of the post office. Nevertheless, since there is a post office in the city, there is no difficulty if there is time to reach the farthest point in the city before the commencement of the Sabbath.
If there is no person designated to fulfill this function and the gentile to whom one gives the letter is the one who brings it to the other city, it is always forbidden to send a letter with a gentile90For the gentile will be performing work on the Jew's behalf on the Sabbath. This ruling is based on Rabbenu Yitzchak Alfasi's interpretation of Shabbat 19a. Rashi and the Tur (Orach Chayim 247) offer a different interpretation of that source, which allows one to send a letter with a gentile even when a fixed fee was not set, provided one sent it with him on Thursday or earlier.
The Shulchan Aruch (Orach Chayim 247:1) quotes the Rambam's ruling, while the Ramah follows that of the Tur.
unless one establishes a fixed price [beforehand].

הלכה כא
נָכְרִי שֶׁהֵבִיא חֲפָצָיו בְּשַׁבָּת וְהִכְנִיסָן לְבֵית יִשְׂרָאֵל מֻתָּר. וַאֲפִלּוּ אָמַר לוֹ הַנִּיחָן בְּזָוִית זוֹ הֲרֵי זֶה מֻתָּר. וּמְזַמְּנִין אֶת הַנָּכְרִי בְּשַׁבָּת וְנוֹתְנִין לְפָנָיו מְזוֹנוֹת לְאָכְלָן. וְאִם נְטָלָן וְיָצָא אֵין נִזְקָקִין לוֹ מִפְּנֵי שֶׁאֵין שְׁבִיתָתוֹ עָלֵינוּ. וְכֵן נוֹתְנִין מְזוֹנוֹת לִפְנֵי הַכֶּלֶב בֶּחָצֵר וְאִם נְטָלָן וְיָצָא אֵין נִזְקָקִין לוֹ:
כסף משנה
21.
It is permissible for a gentile carrying his possessions to bring them into the Jew's house on the Sabbath.91Even though the gentile charges the Jew with watching his possessions, there is no prohibition (Maggid Mishneh). Similarly, the Ramah (Orach Chayim 307:22) mentions that a gentile may bring a Jew grain as payment for debts on the Sabbath. It is even permissible for [the Jew] to tell [the gentile], "Place them in this corner."92Since this activity is being performed by the gentile for his own interests on his own volition, there is no prohibition against giving him instructions. A Jew may tell a gentile to perform labor for the gentile's own sake on the Sabbath (Maggid Mishneh).
One may invite a gentile to visit on the Sabbath and serve food93In contrast, this is forbidden on a festival. In the latter instance, the possibility exists that for the sake of the gentile one may add to the food that one is cooking. Although one is permitted to cook for the sake of Jews on a festival, one may not do so for the sake of a gentile. In contrast, no cooking whatsoever is permitted on the Sabbath. Hence, there is no need for concern (Hilchot Sh'vitat Yom Tov 1:13). for him to eat.94One may not, however, give a gentile food with the intent that he take it out. (See Shulchan Aruch, Orach Chayim 325:1 and commentaries.) If he took the food outside [the Jew's] home, there is no difficulty, for one is not obligated to see that he observes the Sabbath.95The Mechilta, Parashat Bo, Chapter 9, derives this from the verse, "Six days shall you perform your work, and on the seventh day you shall rest." The mitzvah of resting on the seventh day concerns only "your work," and not that of a gentile. 97. As the Rambam writes in Chapter 21, Halachah 36, on the Sabbath a person is allowed to provide food only for animals that are dependent on him for their sustenance. (See Shulchan Aruch, Orach Chayim 324:11 and commentaries which question whether this also applies to a stray dog or not.)
Similarly, one may serve food to a dog in one's courtyard. If he takes it outside, there is no difficulty.

הלכה כב
מִי שֶׁהָיָה בָּא בַּדֶּרֶךְ וְקָדַשׁ עָלָיו הַיּוֹם וְהָיוּ עִמּוֹ מָעוֹת נוֹתֵן כִּיסוֹ לְנָכְרִי לְהוֹלִיכוֹ לוֹ וּלְמוֹצָאֵי שַׁבָּת לוֹקְחוֹ מִמֶּנּוּ. וְאַף עַל פִּי שֶׁלֹּא נָתַן לוֹ שָׂכָר עַל זֶה. וְאַף עַל פִּי שֶׁנְּתָנוֹ לוֹ מִשֶּׁחֲשֵׁכָה מֻתָּר מִפְּנֵי שֶׁאָדָם בָּהוּל עַל מָמוֹנוֹ וְאִי אֶפְשָׁר שֶׁיַּשְׁלִיכֶנּוּ. וְאִם לֹא תַּתִּיר לוֹ דָּבָר זֶה שֶׁאֵין אִסּוּרוֹ אֶלָּא מִדִּבְרֵי סוֹפְרִים יָבוֹא לַהֲבִיאוֹ בְּיָדוֹ וְעוֹבֵר עַל מְלָאכָה שֶׁל תּוֹרָה. בַּמֶּה דְּבָרִים אֲמוּרִים בְּכִיסוֹ אֲבָל מְצִיאָה לֹא יִתֵּן לַנָּכְרִי אֶלָּא מוֹלִיכָהּ בְּפָחוֹת פָּחוֹת מֵאַרְבַּע אַמּוֹת:
כסף משנה
22.
When a person is carrying money while traveling on a journey and the Sabbath commences, he should give his wallet to a gentile to carry for him. On Saturday night, he may take it back from him. This is permitted even though he did not pay the gentile for his services96Were the gentile to be paid a fixed fee, there would be no difficulty, because he would be carrying the wallet to earn the fee and not on behalf of the Jew. and even though he gave it to him after nightfall.97As mentioned in Halachot 19 and 20, a gentile must generally remove any objects he has been given to take from a Jew's domain before the commencement of the Sabbath.
These leniencies are granted because a person becomes distraught over his money and cannot bear to discard it. If we do not allow him [to have a gentile carry it for him] - a matter forbidden merely by Rabbinic decree - we fear that he will come to carry it himself98From the Rambam's statements, it appears that it is preferable for a person to have a gentile carry his wallet for him than for him to carry it himself less than four cubits at time. This and other related matters are discussed in Chapter 20, Halachot 6-7, and commentary.and thus transgress one of the Torah's prohibitions.99We find several instances where the Sages relaxed the prohibitions they imposed for fear that as a result a person would lose control, and ignore Torah law entirely. Similarly, in this instance, they felt it preferable to allow a person to instruct a gentile to perform a forbidden labor on his behalf - a Rabbinic prohibition, so that he would not come to carry the wallet himself in the public domain - a prohibition of the Torah.
On the basis of this principle. The Sefer HaTerumah offers a further leniency. A person who is pursued by gentiles may take his money and hide it. The Rashba and others do not, however, agree to this extension.

When do the above [leniencies] apply? With regard to one's wallet. In contrast, a person may not give an ownerless object that he discovered to a gentile [to carry for him].100Since this is money that did not belong to him originally, the person is less concerned about it. Hence, the Sages granted less leniency. Instead, he should carry it less than four cubits at a time101Many other authorities do not allow the finder to carry the object discovered at all. The Rambam's view is discussed in the notes on Chapter 20, Halachah 7. [until he reaches a place where he can deposit it].

הלכה כג
יִשְׂרָאֵל שֶׁעָשָׂה מְלָאכָה בְּשַׁבָּת אִם עָבַר וְעָשָׂה בְּזָדוֹן אָסוּר לוֹ לֵהָנוֹת בְּאוֹתָהּ מְלָאכָה לְעוֹלָם. וּשְׁאָר יִשְׂרָאֵל מֻתָּר לָהֶם לֵהָנוֹת בָּהּ לְמוֹצָאֵי שַׁבָּת מִיָּד שֶׁנֶּאֱמַר (שמות לא יד) "וּשְׁמַרְתֶּם אֶת הַשַּׁבָּת כִּי קֹדֶשׁ הִיא", הִיא קֹדֶשׁ וְאֵין מַעֲשֶׂיהָ קֹדֶשׁ. כֵּיצַד. יִשְׂרָאֵל שֶׁבִּשֵּׁל בְּשַׁבָּת בְּמֵזִיד. לְמוֹצָאֵי שַׁבָּת יֵאָכֵל לַאֲחֵרִים אֲבָל לוֹ לֹא יֵאָכֵל עוֹלָמִית. וְאִם בִּשֵּׁל בִּשְׁגָגָה לְמוֹצָאֵי שַׁבָּת יֹאכַל בֵּין הוּא בֵּין אֲחֵרִים מִיָּד. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
23.
[The following rules apply when] a Jew performs a [forbidden] labor on the Sabbath: If he willingly transgressed, it is forbidden for him to benefit from this labor forever.102This is also a Rabbinic prohibition. (See Shabbat 38a and also Ketubot 34a, which mentions three different opinions of the Sages on this matter.) The Rambam follows the opinion of Rabbi Yehudah, which is the intermediate view. The person may, however, benefit from the sale of the proceeds of such labor (Mishnah Berurah 218:4). Other Jews103Even a person for whom this labor was performed may benefit from it. Although this is forbidden with regard to other prohibitions, in this instance the Sages did not feel that such a restriction was necessary. It is unlikely that one Jew would ask another to violate the Sabbath laws on his behalf, nor is likely that the person of whom such a request was made would agree (Shulchan Aruch HaRav 218:1, Mishnah Berurah 218:5). may, however, benefit from this labor immediately after the conclusion of the Sabbath,104When a gentile performs a forbidden labor on behalf of a Jew (Halachah 8) and when food is left to warm in a forbidden fashion (Chapter 3, Halachah 9), a Jew is forbidden to benefit from these activities until enough time passes on Saturday night for the activity to have been performed. Nevertheless, these restrictions are punitive in nature, instituted so that one would not perform either of these forbidden activities. In contrast, as mentioned in the previous note, we do not suspect that one Jew will transgress the Sabbath laws on behalf of another individual. Hence, these restrictions were not applied under these circumstances. as [can be inferred from Exodus 31:14]: "And you shall observe the Sabbath, for it is holy." [Our Sages105Ketubot 34a. commented,] "It is holy, but the fruits of labor performed on it are not holy."106The Hebrew, translated as "holy," also means "consecrated." Consecrated articles may not be used for mundane purposes.
What is implied? When a Jew cooks [food] on the Sabbath in willful violation [of the Sabbath laws], other Jews may partake of it Saturday night. He, however, is forbidden to partake of it forever. If he cooked it without knowing of the prohibition he was violating, both he107Since the transgression was not willfully performed, the person is not prohibited from benefiting from his act. and others may eat it immediately after the conclusion of the Sabbath.108The fruits of the forbidden activity are forbidden until Saturday night, lest one willfully perform a transgression and seek license to benefit from his activity on the grounds that the transgression was performed inadvertently.
This is the opinion of Rabbi Yehudah (Shabbat 38a, Ketubot, loc. cit.). Tosafot, however, quotes the opinion of Rabbi Meir, who allows one to benefit on the Sabbath itself from a forbidden activity performed without a willful desire to transgress. The Mishnah Berurah 318:7 mentions opinions that allow one to rely on Tosafot's opinion in a situation of necessity. This leniency is not, however, accepted by all authorities.
In regard to deriving benefit from the performance of an activity on the Sabbath which was forbidden by the Sages, see also Chapter 23, Halachah 8.
The same principles apply in other similar situations.

הלכה כד
פֵּרוֹת שֶׁיָּצְאוּ חוּץ לַתְּחוּם וְחָזְרוּ. בְּשׁוֹגֵג יֵאָכְלוּ בְּשַׁבָּת שֶׁהֲרֵי לֹא נַעֲשָׂה בְּגוּפָן מַעֲשֶׂה וְלֹא נִשְׁתַּנּוּ. בְּמֵזִיד לֹא יֵאָכְלוּ עַד מוֹצָאֵי שַׁבָּת:
כסף משנה
24.
When produce was taken outside a city's Sabbath limits and then brought back without the knowledge of the prohibition involved, one may partake of it on the Sabbath, since nothing was done to the fruits themselves, and their state did not change. If they were brought back in willful violation of the prohibition involved,109If they were brought back by a gentile, a deaf mute, a mentally incapable person, or a child, they are permitted, for these individuals are not obligated to keep the Sabbath prohibitions. one may not partake of them until after the conclusion of the Sabbath.110The Ra'avad questions the Rambam's opinion, noting that although there is a difference of opinion among the Sages of the Mishnah about the matter (see Eruvin 41b), Rav Pappa, one of the later Sages of the Talmud, adopted a more lenient opinion, allowing one to benefit from the produce if it was brought to its original place, even if this was done willfully. Significantly, the Rambam also quotes Rav Pappa's opinion in Hilchot Sh'vitat Yom Tov 5:10. The Maggid Mishneh, however, supports the Rambam's ruling, explaining that the laws of the Sabbath are more stringent than those of the festivals in this context. (See also the distinction between the Sabbath and holidays made by the Tzafenat Paneach.)
The Maggid Mishneh also mentions an opinion of the Rashba which is more stringent than both the Rambam and the Ra'avad.

הלכה כה
הַשּׂוֹכֵר אֶת הַפּוֹעֵל לִשְׁמֹר לוֹ אֶת הַפָּרָה וְאֶת הַתִּינוֹק לֹא יִתֵּן לוֹ שְׂכָרוֹ שֶׁל שַׁבָּת. לְפִיכָךְ אֵין אַחֲרָיוּת שַׁבָּת עָלָיו. וְאִם הָיָה הַשָּׂכִיר שְׂכִיר שַׁבָּת אוֹ שְׂכִיר שָׁנָה נוֹתֵן לוֹ שְׂכָרוֹ מָשְׁלָם. לְפִיכָךְ אַחֲרָיוּת שַׁבָּת עָלָיו. וְלֹא יֹאמַר לוֹ תֵּן לִי שְׂכָרִי שֶׁל שַׁבָּת אֶלָּא אוֹמֵר לוֹ תֵּן לִי שְׂכָרִי שֶׁל שָׁנָה אוֹ שֶׁל עֲשָׂרָה יָמִים:
כסף משנה
25.
When a person hires a worker to watch a cow or a baby, he should not pay him a wage for the Sabbath day.111When a worker is paid for serving as a watchman on a daily basis, he may not take a wage for watching on the Sabbath. Although watching a cow or a child is not a forbidden activity, it is forbidden to receive payment for the Sabbath as a separate and independent entity. Therefore, [the worker] is not responsible for what happens on the Sabbath.112Note Shulchan Aruch HaRav 306:8, which states that although he does not have the responsibilities of a paid watchman on the Sabbath, he still has the responsibilities of an unpaid watchman.If a worker was hired on a weekly or annual basis, he is given full payment.113I.e., the payment he receives can include recompense for the services rendered on the Sabbath, as long as the number of days he works is not considered individually, but rather he receives payment for a month's work as a lump sum. Therefore, [the worker] is responsible for what happens on the Sabbath. [In the latter instance,] the worker should not say, "Pay me for the Sabbath," but rather, "Pay me for the year," or "Pay me for the ten days."114I.e., he hires himself out for a ten day period. Each of these days may not be considered as an individual entity as above.
Alternatively, the Mishnah Berurah 306:18 explains that "Pay me for the ten days" can be interpreted as referring to a situation in which a worker accepted a monthly contract and left the job after working ten days. Since he worked on a monthly basis, he is entitled to payment for all ten days he worked, including the Sabbath. This, however, is a delicate manner, and the exact wording of the contract between an employer and employee should be checked with a Rabbinic authority to prevent any problems from arising in this regard.
It must be emphasized that the same principles also apply with regard to the rental of homes, or money lent at interest to a gentile. One may not receive payment for the Sabbath individually. Instead, one must receive payment on a weekly, monthly, or annual basis. Thus, problems may arise if interest is compounded daily and the Sabbath is included as one of the days. (See Shulchan Aruch HaRav 306:9.)

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