The Shulhan Aruch, in discussing the laws of Yom Tob (Orah Haim 514:6), rules that it is forbidden to place a kindled lamp in a tree before Yom Tob. Since it is permissible to use fire on Yom Tob, the Sages forbade placing a lamp in a tree before Yom Tob, as one might then make use of the tree on Yom Tob which is forbidden. On Shabbat, however, it is forbidden to use fire, and thus the Shulhan Aruch rules (in 277) that it is permissible to place a kindled lamp in a tree before Shabbat, as there is no concern that one might use the tree.
The Hida (Rav Haim Yosef David Azulai, 1724-1806), in his Birkeh Yosef, makes an important inference from the Shulhan Aruch’s formulation of this Halacha. In discussing the laws of Shabbat, the Shulhan Aruch writes that on Shabbat there is no concern that one will "take the lamp from the tree," implying that simply taking something from a tree is forbidden on Shabbat. Even if one does not climb on the tree, it is still forbidden to take something from the tree. The Hida infers from this formulation that the Shulhan Aruch accepted the position of Rashi (Rav Shlomo Yishaki of Troyes, France, 1040-1105), that taking something from a tree is forbidden on Shabbat, even if one does not climb on the tree.
The Hida notes, however, that in discussing the laws of Yom Tob, the Shulhan Aruch writes that one may not leave a lamp in a tree before Yom Tob because one may then "make use of the tree" on Yom Tob. This formulation suggests that the only prohibition is using the tree, while simply taking something from a tree is permissible. The Hida dismisses this question, however, noting that the Shulhan Aruch was simply citing the formulation of the Tur (Rabbenu Yaakob Ben Asher, Spain, 1269-1343), who forbade only climbing trees. But the Shulhan Aruch follows Rashi’s view, and forbids even taking something from a tree – or placing something on a tree – on Shabbat, and this is, indeed, the final Halacha.
Summary: On Shabbat and Yom Tob it is forbidden to climb a tree, to place something on a tree, and to take something from a tree.