Add the butter to a microwave-safe bowl and heat in 20–30 second bursts until melted. Let it cool on the counter for about 5–10 minutes, until warm but not hot to the touch so it doesn’t cook the eggs.
1 cup unsalted butter
In a large mixing bowl, whisk together the melted, slightly cooled butter, granulated sugar, and brown sugar until thick and glossy, about 30–45 seconds. Add the eggs and extra yolk one at a time, whisking well after each addition, then stir in the vanilla extract until the mixture is smooth and slightly lighter in color.
1 cup unsalted butter, 1 1/4 cups granulated sugar, 3/4 cup light brown sugar, 2 large eggs, 1 large egg yolk, 2 teaspoons pure vanilla extract
In a separate medium bowl, whisk together the flour, cocoa powder, baking soda, baking powder, and salt, breaking up any clumps of cocoa so everything is evenly mixed.
1 3/4 cups all-purpose flour, 3/4 cup unsweetened cocoa powder, 1 teaspoon baking soda, 1/2 teaspoon baking powder, 3/4 teaspoon kosher salt
Add the dry ingredients to the wet ingredients in two additions, gently folding with a spatula just until no dry streaks of flour remain. The dough will be thick, rich, and a bit sticky—more like brownie batter than classic cookie dough. Avoid overmixing to keep the cookies soft and fudgy.
1 3/4 cups all-purpose flour, 3/4 cup unsweetened cocoa powder, 1 teaspoon baking soda, 1/2 teaspoon baking powder, 3/4 teaspoon kosher salt
Fold in the chocolate chips and, if using, the chopped nuts, reserving a small handful of chocolate chips to press on top of the cookies before baking.
1 1/4 cups semisweet chocolate chips or chunks, 1/2 cup chopped walnuts or pecans
Cover the bowl with plastic wrap or a reusable lid and refrigerate the dough for 30–45 minutes to allow the flour to hydrate and to keep the cookies from spreading too much. If you skip chilling, the cookies will bake thinner and less chewy.
When the dough is almost done chilling, preheat the oven to 350°F (175°C). Line two baking sheets with parchment paper or silicone baking mats.
Use a 1 1/2 to 2 tablespoon cookie scoop to portion the dough onto the prepared baking sheets, spacing the scoops about 2 inches apart. Roll each portion gently between your palms to form a smooth ball, then press a few of the reserved chocolate chips into the tops for a bakery-style look. If the dough is very firm from chilling longer than an hour, let it rest at room temperature for about 5 minutes before scooping.
1 1/4 cups semisweet chocolate chips or chunks
Bake one sheet at a time on the center rack for 9–11 minutes, just until the edges look set and the tops are slightly cracked while the centers still look soft. Do not wait for the cookies to look completely dry on top or they will end up cakey instead of fudgy.
Let the cookies cool on the baking sheet for 5–10 minutes to allow the centers to set, then transfer them to a wire rack to cool completely. If you like salty-sweet flavor, sprinkle a tiny pinch of flaky sea salt on top of each cookie right after baking while they are still warm.
flaky sea salt
Store completely cooled cookies in an airtight container at room temperature for 3–4 days. To freeze, arrange cooled cookies in a single layer on a baking sheet, freeze until solid, then transfer to a freezer-safe bag or container, pressing out extra air. Freeze for up to 2 months. Thaw at room temperature for 20–30 minutes or warm in the microwave for 10–15 seconds.
For freeze-ahead dough, scoop the chilled dough into balls, place on a parchment-lined tray, and freeze until firm. Transfer to a labeled freezer bag. Bake from frozen at 350°F, adding 1–2 minutes to the bake time, until the edges are set and the centers still look soft.