Preheat oven to 175°C / 350°F (160°C fan). Line two baking sheets with parchment paper. Do not grease.
Whisk flour, baking soda, baking powder, and salt together in a medium bowl. Set aside.
Beat softened butter and peanut butter together on medium speed for 1 minute. Add both sugars and beat for a full 3 minutes until the mixture is pale and slightly fluffy.
Add the egg and vanilla extract together. Beat for 30 seconds until fully incorporated.
Add the flour mixture all at once. Mix on low speed until just combined — stop the moment you no longer see dry streaks.
Scoop dough into 1½-tablespoon balls. Roll between palms until smooth, then roll in granulated sugar if using. Place 5cm / 2 inches apart on the prepared trays. Press each ball flat with a fork in a crosshatch pattern to about 1cm / ½ inch thick.
Bake one tray at a time on the centre rack for 10 to 12 minutes. The edges should look set and the centres should still look slightly underdone.
Cool on the baking sheet for 5 minutes, then transfer to a wire rack to cool completely.