Yosef Karo, Translation:Shulchan Aruch — Orach Chaim 336…
“ Paragraph 1 - We do not climb a tree, whether it is wet or dry, nor do we hang from it, nor do we use anything attached to the ground. This is a rabbinic decree lest one come to climb the tree and pick something from it. If someone climbed a tree on Shabbat by mistake, he is permitted to descend. If he did it on purpose, he is not allowed to descend. If he climbed the tree when it was still day on Friday, he is always allowed to descend after it gets dark. ”
