Preheat oven to 400°F (200°C) and line a baking sheet with parchment paper.
Unfold one puff pastry sheet and spread a thin, even layer of basil pesto over it.
Sprinkle shredded cheese over the pesto layer evenly.
Place the second puff pastry sheet on top and gently press to seal the edges.
Using a sharp knife, cut the layered pastry into 1/2-inch wide strips, keeping them attached along a central 'trunk' line to form a tree shape.
Starting from the bottom, twist each strip away from the center to create twisted branches with some space between twists.
Brush the entire assembled pastry tree with egg wash for a golden finish.
Sprinkle grated Parmesan cheese and optional seeds or nuts on top if desired.
Bake in the preheated oven for 15 to 20 minutes until golden, puffed, and the cheese is melted.
Cool slightly, then serve by pulling apart the branches to enjoy.