Sift flour, cocoa, baking soda and salt in a medium bowl and whisk to blend evenly.
Combine butter with both sugars and vanilla in the bowl of a stand mixer fitted with the paddle attachment and beat on medium speed for 2-3 minutes until slightly fluffy and lightened in colour by a shade. Stop to scrape down the sides of the bowl a few times during mixing. Beat in egg until well combined. Add dry ingredients and mix on low until just combined. Cover the bowl and refrigerate while you preheat the oven.
For the filling, mix together peanut butter and flour in a small bowl and place in the freezer to chill for 10 minutes. Scoop up just teaspoons of the filling and place them onto a lined tray and freeze the individual portions for 10 minutes so that they are firm enough to handle more easily.
Preheat oven to 350°F. Line 2 large baking sheets with parchment paper.
Scoop up about 2 tablespoons of dough and roll into smooth balls, then flatten the balls in the palm of your hand. Place a ball of peanut butter filling in the middle and carefully wrap the cookie dough around it, pinching it at the seams to encase the peanut butter, then roll it in your hands to smooth it out. Place onto prepared baking sheets spacing them 2 inches apart. Bake for 9-11 minutes until puffed and the tops are cracked but they are still soft in the middle. Transfer to a rack and let cookies cool on trays for 3 minutes before transferring individually to the rack to finish cooling.