Preheat the oven to 190C/375F/Gas 5. Line three baking trays with parchment paper. Set aside.
Sift the flour, cocoa powder, baking soda, baking powder, and salt into a bowl. Set aside.
Using a handheld or stand mixer fitted with the paddle attachment, cream the butter and sugar together for 5 minutes until light and fluffy. Add the egg and beat on medium speed until just incorporated.
Lower the speed and add the dry ingredients gradually until the dough is well combined.
Using a small scoop or teaspoon, drop round dough balls (weighing about 15g/1/2oz each) onto the prepared baking trays about 5cm (2") apart.
Press the bottom of a glass into a bowl of sugar and use to flatten the cookie dough to about 1/4" thick.
Bake for about 10 minutes until the cookies are firm. Transfer to a wire rack to cool completely.
For the Vanilla Filling
Using a handheld or stand mixer fitted with the paddle attachment, beat the butter until light and fluffy. On low speed, carefully add the icing sugar. Turn up the speed and beat for 3 minutes until light and fluffy.
Add the vanilla and continue to beat for at least 2 more minutes.
Transfer the filling to a piping bag and pipe about 1 tablespoon of the filling onto one of the cookies, leaving a little space around the edges.
Cover with another cookie and gently press together so that the filling squeezes out near the edges of the cookies.
Repeat with all the cookies.
Notes
Cookies keep fresh stored in an airtight container in the fridge for up to 1 week. They also freeze well, wrapped individually, for up to 3 months. Thaw overnight in the fridge before serving.