Preheat the oven to 350 degrees F. Line a baking sheet with parchment paper.
Sift together the flour, baking powder, baking soda, and salt into a medium bowl and set aside.
Place the butter, granulated sugar, and light brown sugar in the bowl of an electric mixer and cream the ingredients on high speed. Scrape down the sides of the bowl with a rubber spatula. Add the vanilla and egg and mix on medium speed. Add the flour mixture and mix on low speed just until batter is stiff˝don't overdo it! Turn off the mixer and, using a large spoon or plastic spatula, fold in the chocolate chips and the walnuts, if desired.
Using a tablespoon, scoop about 2 spoonfuls of the dough into a ball and place on the baking sheet. Repeat with remaining dough, keeping the scoops about 2 inches apart. Using your fingers or the back of the spoon, press down on each ball of dough to slightly flatten. (You should get about 9 cookies on each sheet.) Bake until golden brown, about 20 minutes. (Depending on the size of your oven, you may need to do this in batches.)
Using oven mitts or pot holders, remove the cookies from the oven and transfer with a plastic turner to wire racks to cool. Repeat with the remaining sheets, if necessary.
In the bowl of an electric mixer, combine peanut butter, powdered sugar, vanilla, and chocolate sauce and beat well.
With a thin metal pastry spatula or a butter knife, spread a layer of the peanut butter filling on the bottom of a cookie.
Press another cookie over the filling to make a sandwich.
Yield: about 14 cookie sandwiches