Preheat the oven to 350°F and line a large rimmed baking sheet with parchment paper and set aside.
In a large bowl, whisk together the flour, cocoa powder, baking powder, baking soda, and salt. Set aside.
1¼ cups all-purpose flour, ¼ tablespoons unsweetened baking cocoa, 1 teaspoon baking powder, ¼ teaspoon baking soda, ½ teaspoon salt
In a separate large bowl or stand mixer, cream together the butter and sugar until light and fluffy. Beat in the egg and vanilla extract just until combined.
½ cup unsalted butter, ⅓ cup granulated sugar, 1 large egg, 1½ teaspoons vanilla extract
Mix in the melted chocolate until incorporated. Stir in half of the dry ingredients, mixing until just combined. Add the buttermilk and mix, then stir in remaining dry ingredients, mixing until just combined.
2 ounces bittersweet chocolate, ¼ cup buttermilk
Use a medium cookie scoop to drop rounded balls of dough 2 inches apart on the prepared baking sheets.
Bake for 7 to 9 minutes until the tops of the cookies are just set. Do not overbake - even 1 extra minute can dry out these cookies. Remove from the oven and allow the cookies to cool slightly on the baking sheets. Do not remove cookies from the baking sheets.
While the cookies are baking, combine the butter, heavy cream, cocoa powder, vanilla extract, and salt in a small saucepan and cook over low heat. Whisk until butter is melted and the frosting is smooth. Whisk in powdered sugar 1 cup at a time, mixing thoroughly after each addition. Keep whisking over low heat until frosting is smooth and shiny, 1 to 2 minutes.
5 tablespoons unsalted butter, 5 tablespoons heavy cream, 3 tablespoons unsweetened baking cocoa, 1 teaspoon vanilla extract, ¼ teaspoon salt, 2 cups powdered sugar
Remove the frosting from heat and immediately pour 1 to 2 tablespoons over each cookie while still warm. Sprinkle with nut pieces if desired. Let the frosted cookies cool completely before gently removing them from the baking sheet.
⅓ cup finely chopped nuts