Roll out a sheet of puff pastry and spread the pesto evenly over it, leaving a small amount of room at the edges. Sprinkle over the mozzarella and place another sheet of puff pastry on top, making a sandwich.
Cut into thin strips with a sharp knife. Grab both ends of each strip, press down firmly to seal the edges and twist.
Transfer onto a baking tray lined with baking paper, and brush with beaten egg. Season with salt and pepper and sprinkle over the parmesan.