Position a rack in the center of your oven and preheat the oven to 350°F. Butter or coat an 8-inch square baking pan with nonstick spray. Line the pan with a strip of parchment paper that hangs over two of the edges.
MAKE THE CAKE: In a large bowl, whisk the brown sugar and eggs until pale and foamy, about 1 minute. Add the peanut butter, oil, milk, vanilla, and kosher salt. Whisk the mixture until smooth and emulsified. Add the cocoa powder and whisk until smooth.
Add the flour, baking powder, and baking soda and whisk until well-combined and smooth. Lastly, add the coffee and stir until well-combined and smooth.
Pour the batter into the prepared pan, tap the pan gently on the counter to release any air bubbles, and smooth the top of the batter with an offset spatula.
Bake the cake until puffed and a tester inserted into the center comes out clean, 45 to 55 minutes. Set the cake on a rack to cool for about 15 minutes. Then use the parchment paper to lift the cake out of the pan and set it on the rack to cool completely.
MAKE THE GLAZE: In a bowl, whisk the confectioners’ sugar, peanut butter, vanilla, kosher salt, and 1 tablespoon hot water until smooth. If the glaze is very thick, add more water, a few drops at a time, until it is a smooth and pourable consistency.
Pour the glaze over the cooled cake and sprinkle with chopped peanuts and a few sprinkles of flaky salt (if using). Let the glaze set for about 20 minutes before slicing the cake. (Store the cake, well-covered, at room temperature for up to three days.)
Use Another Pan
LOAF: Bake in a 9 x 5 x 3-inch loaf pan until puffed and a skewer inserted into the center comes out clean, 55 to 65 minutes. You’ll need a half batch of glaze to coat the cake in a thin layer.
ROUND: Bake in a 9-inch round pan until puffed and a tester inserted into the center comes out clean, 45 to 55 minutes.
Dress It Up
Top slices of cake with Cocoa Whip (page 180) and mini peanut butter cups. Yeah, that’s right, I said to top a cake with peanut butter cups.