Add the softened butter, brown sugar, and granulated sugar to a large mixing bowl. Beat until light and creamy.
Mix in the sourdough discard, egg, and vanilla extract until everything is well combined.
In a separate bowl, whisk together the flour, cocoa powder, cornstarch, baking soda, baking powder, and salt.
Slowly add the dry ingredients to the wet ingredients. Mix just until everything comes together. Don't overmix the dough.
Cover the bowl with plastic wrap or a lid and refrigerate it for about 30 minutes to 3 days. This will make the cookies easier to scoop and can help prevent excessive spreading. For long fermentation, refrigerate for up to 3 days.
Use a cookie scoop to portion the dough onto a parchment lined baking sheet. Leave plenty of room between the cookies.
Bake for 10-12 minutes for smaller cookies and 18-20 minutes for large bakery-style cookies until the edges are set but the centers still look slightly soft. Be careful not to overbake them. Baking time varies based on size of the cookie.
Let the cookies cool on the baking sheet for several minutes before transferring them to a cooling rack. They will continue to set as they cool.
Notes
Long fermentation. After making the cookie dough, cover and refrigerate for up to 3 days.
Perfectly round cookies. To make them perfectly round and bakery style, use a large crumpet ring, swirl around each cookie soon after they come out of the oven.
Don't overbake them. Chocolate cookies can be tricky because it's harder to tell when they're done. Look for set edges and slightly soft centers.
Use softened butter. You don't want melted butter for this recipe. Softened butter creams properly with the sugar and gives you the right cookie texture.
Let them cool before moving them. These cookies are soft when they first come out of the oven, so give them a few minutes on the baking sheet before transferring them.
Make ahead of time and freeze for later. I love making cookies ahead of time and then freezing dough balls on a parchment lined cookie sheet. Once frozen, transfer to a freezer-safe bag and place in the freezer up to 3 months. Any time you need a cookie, pop one out and bake like you would a regular cookie.