As a precaution, the Sages prohibited using a tree on Shabbat, out of concern that one may end up breaking off a branch or leaf. Therefore, one may not climb or lean against a tree and may not place items on trees or remove items from them. If the wind blows an item of clothing into a tree on Shabbat, one may not remove it. Similarly, one may not recover a ball that fell into a tree nor shake the tree so that the ball will fall out (SA 336:1; MB ad loc. 3). One should take care not to place things on a tree before Shabbat if they will be needed on Shabbat (MB 336:12). However, one may touch a tree if he is not using or moving it (Rema 336:13).
Not only is using a tree prohibited, it is also prohibited to use items resting directly on a tree. For example, one may not use a swing that is attached to a tree, even if only one side is attached. One may not remove an item of clothing from a clothesline that is tied to a tree. Similarly, one may not climb a ladder that is resting against a tree, and one may not remove things from a basket hanging from a tree.
However, if a peg was driven into a tree and a swing was hung from the peg, one may use the swing. This is because only the peg is considered resting on the tree, while the swing is resting on the peg. Since the swing is two steps removed from the tree, this was not included in the rabbinic prohibition. Similarly, one may remove an item of clothing from a clothesline that is tied to a peg stuck into a tree, because the clothesline is two steps removed from the tree. If before Shabbat one rested a ladder against a peg embedded in a tree, one may climb the ladder on Shabbat, because the ladder is two steps removed from the tree. If before Shabbat items were placed in a basket hanging from a hook stuck in a tree, one may put items into it and remove them on Shabbat, because this too is two steps removed from the tree. However, on Shabbat one may not rest the ladder against the peg or hang the basket on the hook, because that would be making use of an item resting directly on a tree (SA 336:13; MB ad loc. 63).
Regarding the roots of an old tree that protrude above the ground, if they protrude less than three tefaĥim from the ground (about 23 cm), then they are considered equivalent to the ground, and one may sit upon them. However, if the roots protrude above this height, they are considered equivalent to a tree, and one may not sit upon them (SA 336:2).
. The prohibition of leaning against a tree applies only when one puts all his weight on it. In contrast, a healthy person may lean a bit on a strong tree, since leaning on it slightly is not considered using the tree. This is on condition that the tree is strong enough that it will not move. Furthermore, a weak person may not lean even slightly on the tree, since due to his weakness he may end up shifting all his weight onto the tree and thus violate the prohibition of using it (MB 336:63).One who unknowingly climbed a tree may descend even though he will be using the tree again, because remaining in the tree would also be considered using it. However, if he purposely climbed a tree on Shabbat, the Sages mandated as a penalty that he may not descend until Shabbat is over (SA 336:1). If he can get down by simply jumping, without using the tree, he should do so (R. Shlomo Zalman Auerbach cited in SSK ch. 26 n. 45).