Prep the pastry: Let the puff pastry thaw in the fridge until pliable. Lightly flour your work surface and roll it into a rectangle, roughly 10x12 inches.
Keep edges even for tidy pinwheels.
Spread the pesto: Spoon pesto over the pastry and spread into a thin, even layer. Leave a 1/2-inch border on one long edge to help seal the roll.
Add the cheese: Sprinkle mozzarella evenly over the pesto. Add Parmesan if using.
Season with a little black pepper and red pepper flakes.
Roll it up: Starting from the long edge opposite the border, roll the pastry into a tight log. Gently press the seam to seal. If it’s soft, wrap the log in plastic and chill for 20–30 minutes to firm up.
Chilled dough slices cleanly.
Preheat and prep: Heat the oven to 400°F (200°C). Line a baking sheet with parchment paper.
Slice: Using a sharp knife, slice the log into 1/2-inch rounds. You should get about 16–20 pieces.
If the knife drags, give the log another 10 minutes in the fridge.
Egg wash: Arrange pinwheels on the baking sheet, leaving space between each. Brush tops and exposed pastry with egg wash for a golden finish.
Bake: Bake for 14–18 minutes, until puffed and deep golden. Cheese should be melted and bubbly.
Cool slightly: Let them rest for 5 minutes on the pan.
Serve warm or at room temperature.