Making a fence around one’s roof:
כִּי תִבְנֶה בַּיִת חָדָשׁ וְעָשִֹיתָ מַעֲקֶה לְגַגֶּךָ וְלֹא תָשִֹים דָּמִים בְּבֵיתֶךָ כִּי יִפֹּל הַנֹּפֵל מִמֶּנּו”
“When you build a new home and make a fence for your roof, and you shall not spill blood in your home when the faller falls from it” [Devarim 22:8]
A. The general rule:
It is a positive command [in the Torah] for a person to make a fence [i.e. guardrail] on his roof [if the roof fulfills the criteria brought n B]. Anyone who leaves his roof [which fulfills the criteria to require a fence] without a fence has nullified a positive command [listed as one of the 248 positive commands] and has transgressed a negative command [listed as one of the 365 negative commands].[One transgresses both of these commands every single moment that his roof which fulfills the criteria to require a fence is left without a fence, and a later building of the fence does not retroactively rectify the transgressions that already took place due to the delay.] This negative command applies both for roofs and for anything else that poses a danger, and that a person can stumble on and die. [By a roof, the negative command can be avoided by simply not owning a roof that requires a fence, or mending the roof or ground in a way that it does not require a fence, such as by elevating the ground so the roof is not ten Tefachim from the ground, or by making it slanted so it is not usable. However, the positive command to make a fence can only be fulfilled if one actually makes a fence.]
When is the fence to be built; during construction of the home, or only after moving in?
Some Poskim understand that the fence is to be built on the roof immediately during the construction process, and one is not to wait until one moves into the home and begins using the roof to build the fence. Other Poskim, however, rule that it is to only be built after one actually moves into the home and begins making use of the roof, and becomes obligated to fence it, and so is the Rebbe opinion.
May a fence be built around one’s roof on Chol Hamoed?
It is permitted for one to build a fence around his roof on Chol Hamoed in an unprofessional manner [i.e. Maaseh Hedyot]. [Some Poskim rule that only if the roof is not Halachically obligated to be fenced, such as if it is not commonly used, and one simply desires to do so for extra protection, than it is to be built in an unprofessional manner. However, if the roof is obligated according to Torah law in having a fence put around it, then that the fence may be built even in a professional manner on Chol Hamoed. Practically, all fences are to be built in an unprofessional manner during Chol Hamoed, even if the roof is obligated to be fenced.]
May a person stand on a roof that does not contain a guardrail or fence?
Yes. The entire obligation is merely on the owner to build a fence on top of his roof and does not extend to any individual who goes onto the roof. Accordingly, there is no issue with one going onto roof that is not have a fence even if it is obligated to have one and the owner has yet to put it up. For this reason, there is also no prohibition against climbing up a tree or ladder, even to a very high area.
The reason for the command-A decree of the verse, or a logical safety precaution?
From some Poskim it is evident that the obligation to build a fence around one’s roof is an intrinsic obligation without logic or reason and is not dependent on the level of danger that the roof poses. Thus, for example, they rule that due to a scriptural exclusion, the commonly used roof of a barn or synagogue is not obligated in being fenced, even though it’s level of danger is no different than the roof of a home. Likewise, they imply that even a not commonly used roof of a house is obligated in being fenced. According to this understanding, it is understood why a blessing is recited upon building the fence, even though in general a blessing is never recited by safety precautions, as the building of the fence is an intrinsic and independent command irrelevant of the aspect of danger. Likewise, according to this understanding, it is understood why there is both a positive and negative command involved in this Mitzvah, with the positive command being to build a fence, and the negative command being to not spill blood, even though in general we never list the reason behind a command as a separate Mitzvah. The reason for this is because indeed there are two aspects in the Mitzvah of building a fence on one’s roof, the first being an intrinsic command to build a fence irrelevant of the danger, and the second being to prevent danger. However, from other Poskim, including the rulings of Admur, it is evident that the two matters are connected, and that the obligation of fencing one’s roof is due to the level of danger it poses to a person falling off, and hence whenever this danger does not apply the obligation also does not apply, and whenever the danger applies then the obligation applies, irrelevant as to whether it is the roof of a building or synagogue or home. Nonetheless, even according to the latter approach, one must conclude that the Mitzvah of making a fence to prevent danger is a unique and intrinsic command, and scriptural decree, irrelevant of the issue of danger, as it is possible for one to dismiss the danger by simply lowering the height of the roof, or making it unusable, and nonetheless the Torah commands one to specifically make a fence.
The Kabbalistic meaning behind the mitzvah of building a fence around one’s roof:
The physical command to build a fence around one’s roof derives from the supernal fence that is found around the roof of each of the spiritual world. Each the four spiritual worlds of Atzilus, Beriyah, Yetzirah and Assiyah, contains a roof, between it and its previous world, and these roofs each have a spiritual fence. For example, the ground of the world of Atzilus serves as the roof of the world of Beriyah. The purpose of the fence is to prevent the divine light and revelations of the previous world from falling into the world below it, which can cause a catastrophic destruction of the world and death to the Divine revelations that fall, similar to what already occurred in the world of Tohu with Sheviras Hakeilim. Thus, for example, fence around the roof of the world of Beriyah is there to prevent the divine revelation of the world of Atzilus from falling into Beriyah, which would cause their automatic death.
The Chassidic lesson:
The Divine lesson that can be derived from the Mitzvah to build a fence around one’s roof, is the need for one to make fences around his mundane activities so they don’t lead him to fall into sin. Thus, for example, one who goes out to work after starting his day in prayer and Torah study, needs to make for himself a fence in his work environment which prevents him from being incited to transgression, whether in monetary matters, or matters that pertain with the opposite gender. Likewise, whenever one starts a new job, he must make for himself a fence, so he does not come to stumble. The fence needs to be ten Tefachim high which represents that it penetrates all of one’s ten soul powers. Likewise, when a person gets married and becomes deeply involved in material matters, he must make himself a fence and guard rail to prevent him from falling into the trap of temptation to lead a material life deserting his spiritual values. Through making this fence and guard rail one will reach a much higher level then he was before the marriage. Another lesson that can be derived from this command is that one needs to make a fence around one’s “roof” which refers to one’s haughtiness and arrogance in order to prevent not only one’s own downfall, but also the downfall of others which can be negatively affected with one’s arrogance. This obligation applies even to the roof of the Temple, which corresponds to one’s spiritual activities and accomplishments which one may think earn him bragging rights and require arrogance and pride, as even arrogance due to spiritual matters requires a fence.
 See Admur Shemiras Guf Vinefesh Halacha 1-3; Michaber C.M. 427:1-7; Sefer “Viasisa Meakah”; Likkutei Sichos 2 Parshas Ki Seitzei; Vol. 9 Parshas Ki Seitzei footnote 28; Vol. 19 Ki Seitzei 2; Likkutei Sichos Vol. 19 Ki Seitzei 2; Likkutei Sichos Vol. 24 Ki Seitzei 2; Omitted from Tur; This is the last chapter in Shulchan Aruch!
 Admur Shemiras Guf Vinefesh Halacha 1; Michaber 427:1; Rambam Rotzeiach 11:1; Sefer Hamitzvos Rambam Asei 184; Sifri Ki Seitzei 229; Semag Asei 79; Sefer Hachinuch Mitzvah 546
The scriptural source: As the verse [Devarim 22:8] states “And you shall make a fence for your roof.” [Admur ibid]
 Sefer Hamitzvos of Rambam Mitzvah 184; Chinuch Mitzvah 546
 Sefer Hamitzvos Rambam L.S. 298; Sefer Hachinuch Mitzvah 547
 Admur Shemiras Guf Vinefesh Halacha 3; Michaber 427:6; Rambam Rotzeiach 11:3; Sifri Ki Seitzei 229; Likkutei Sichos 2 Parshas Ki Seitzei
The scriptural source: As the verse [Devarim 22:8] states “Do not spill blood in your home.” [Admur ibid; Michaber ibid]
 Minchas Chinuch 546; See Imreiy Yaakov Biurim 10:1; 8
 Admur Shemiras Guf Vinefesh Halacha 3
 Likkutei Sichos 2 Parshas Ki Seitzei
 See Imreiy Yaakov Biurim 10:1
 Tzafnas Paneiach on Rambam Brachos 11:2; Terumos 4:2; Gidulei Kodesh Y.D. 285:1 that so rule some of the Rishonim that the obligation applies immediately upon building the house; Parshas Sedura on Miseches Mezuzah end of 58 based on Sifri Ki Seitzei which states to build it “Beshaas Chidusho,” which implies that the fence is to be built as soon as the roof is constructed even prior to moving into the home”; Likkutei Sichos 19 Parshas Ki Seitzei 2 based on Sifri Dibei Rav on Sifri based on the word Chidusho; See also Likkutei Sichos Vol. 24 Ki Seitzei 2 footnote 10
 Imreiy Yaakov Biurim 10:1 that so is implied from the commentary of the Malbim on Sifri ibid that Chidusho refers to the time that one desires to move into the home, and that so is implied from the fact that one is not obligated to build a fence on a roof that is not commonly used, and hence how can the obligation apply prior to using the roof and moving into the home; Likkutei Sichos 19 Parshas Ki Seitzei 2 footnote 6 and Vol. 24 footnote 12 in name of Toldas Adam on Sifri and that the opinion of the Sifri is a Daas Yachid, and the Sages argue on it, and so is the Rebbe’s conclusion that the main opinion follows that the obligation does not apply upon construction.
 Michaber O.C. 540:1
 Biur Halacha 540:1 based on Ritva
 Conclusion of Biur Halacha ibid based on Setimas Haposkim; See Imreiy Yaakov Likkutim 10:5
 Chazon Ish Likkutim 18:2; Imreiy Yaakov 10:8
 Maharam Shick on Taryag Mitzvos Mitzvah 547; Likkutei Sichos 2 Parshas Ki Seitzei that so is implied from Rambam; See Imreiy Yaakov Biurim 10:1; All Poskim in coming footnotes
 Chazon Ish Likkutim 18:8; Implication of all Poskim who explain the exemption is scriptural due to it not being a Beis Dirah: Rashi Chulin ibid; Rambam Rotzeiach 11; Michaber ibid; Mabit 2:110, brought in Shach 427:1; See Imreiy Yaakov Biurim ibid
 Maharam Shick on Taryag Mitzvos Mitzvah 547; See Imreiy Yaakov Biurim 10:1
 See Minchas Chinuch 546; Likkutei Sichos 2 Parshas Ki Seitzei; Vol. 9 Parshas Ki Seitzei footnote 28
 See Sefer Hamitzvos of Rambam Shorshei Hamitzvos Shoresh 5
 Likkutei Sichos 2 Parshas Ki Seitzei
 Admur ibid; Smeh 427:2 and 5; Biur Halacha 540:1 based on Ritva “A roof which is not commonly used…is not obligated in a fence”; Chazon Ish Likkutim 18:1 “Every roof which is not used is exempt from a fence”; Imreiy Yaakov Biurim 10:1 in negation of Maharahm Shick and that so is implied from Shita Mekubetzes Bava Metzia 101b
 Initial approach in Likkutei Sichos 2 Parshas Ki Seitzei
 See Eitz Chaim Shaar Hamitzvos Parshas Ki Seitzei pp. 138-142; Eitz Chaim Vol. 2 p. 311 Heichal Zayin, Abiyah Shaar 42 chapter 14; Imreiy Yaakov Likkutim 10:1; Likkutei Sichos 2 Parshas Ki Seitzei
 The Rebbe dedicated many talks to the subject of the Mitzvah of making a fence to one’s roof and derived various Divine lessons from it
 Likkutei Sichos Vol. 2 Ki Seitzei
Why a blessing is said over the fence: The blessing is necessary because the fence is in essence rooted higher than the person and for the person to draw it down he needs special powers which are drawn below from above, which is represented by the blessing which is a Hamashacha. [Rebbe ibid]
 Likkutei Sichos Vol. 19 Ki Seitzei 2
 Likkutei Sichos Vol. 24 Ki Seitzei 2