Mix the peanut butter and powdered sugar until smooth, then scoop into 18 small portions and freeze for 20–30 minutes.
Preheat the oven to 350°F (175°C) and line baking sheets with parchment paper.
Whisk together the flour, baking soda, baking powder, and salt in a medium bowl.
Beat the butter, brown sugar, and granulated sugar until light and fluffy.
Mix in the eggs one at a time, then add the vanilla extract.
Gradually add the dry ingredients and mix until a soft dough forms.
Fold in the chocolate chips if using.
Flatten a portion of cookie dough, place a frozen peanut butter filling in the center, cover with more dough, and seal completely.
Arrange the stuffed dough balls on the prepared baking sheets about 2 inches apart.
Bake for 10–12 minutes until the edges are lightly golden and the centers are just set.
Cool on the baking sheet for 5 minutes before transferring to a wire rack.