Place softened butter and powdered sugar in the bowl of a standing mixer with a paddle attachment. Mix at a low speed for 2 to 4 minutes, or until the butter mixture is pale yellow, light, and fluffy. Add vanilla and mix just until combined. *Scrape the bowl and paddle down two or three times with a spatula during mixing to ensure all the butter bits are mixed in.
Add egg and about half of the flour with the motor running and beat until fully incorporated. Add the rest of the flour, cocoa powder, and salt, and mix until a dough forms. If the dough is too sticky, add a teaspoon of cocoa powder. If it is too dry, add a little water or milk (a teaspoon at a time).
Wrap the dough in plastic wrap and transfer it to the refrigerator for 1-2 hours.
Preheat the oven to 350°F/180°C.
On a lightly floured surface, roll the dough to a ¼-inch (½ cm) thickness and cut circles using a cookie cutter. Place a flat teaspoon of the filling in the center of each circle. Pinch the edges together in three places so that they meet in the middle to form a triangular cookie shape. Fasten and arrange on a baking sheet lined with parchment paper. Don’t put in too much filling, or you won’t be able to close the Hamantaschen. You do not want the filling to come out. Place the baking sheet with the Hamantaschen in the freezer for 30 minutes before baking.
Bake for 15-20 minutes until the dough is slightly golden at the bottom. Let it cool.