Preheat the oven to 375°F (190°C). Line two baking sheets with parchment paper.
In a large bowl, cream together the softened butter, granulated sugar, and brown sugar until light and fluffy, about 2–3 minutes.
Beat in the eggs one at a time, then stir in the vanilla extract and instant espresso powder until fully combined.
In a separate bowl, whisk together the flour, cocoa powder, baking soda, and salt. Gradually add the dry ingredients to the wet mixture, mixing just until incorporated.
Fold in the chocolate chips and nuts (if using) until evenly distributed throughout the dough.
Using a cookie scoop or tablespoon, drop rounded balls of dough onto the prepared baking sheets, spacing them about 2 inches apart.
Bake for 9–11 minutes, or until the edges are set but the centers still appear slightly soft. The cookies will continue to firm up as they cool.
Allow the cookies to cool on the baking sheet for 5 minutes before transferring them to a wire rack to cool completely.
Notes
These cookies are best enjoyed warm with a glass of milk or as an afternoon treat with coffee.