Cream butter and sugar until smooth. Add the egg and mix. Sift in flour and cornstarch; knead until smooth. Chill for 10 minutes.
Divide dough into three portions. Add cocoa to one and pistachios to another, leaving the third plain. Roll each parchment to 1/8-inch thickness. Cut circles with a round cutter.
Place 1 teaspoon filling in the center of each circle. Fold into hamantaschen and pinch edges firmly. Arrange on parchment-lined baking sheets. Bake at 350°F/180°C for 12–14 minutes.
Bake flat cookies on the same sheet for 10 minutes. Transfer to wire racks to cool. Fill sandwich cookies and decorate as desired.