Preheat the oven to 375°F (190°C). Line two baking sheets with parchment paper and set aside.
Sift the dry ingredients: In a medium bowl, sift together the flour, cocoa powder, baking soda, and salt. Set aside.
Cream the butter and sugars: In a large mixing bowl or the bowl of a stand mixer fitted with the paddle attachment, beat the softened butter, brown sugar, and granulated sugar on medium speed for about 2–3 minutes, until light and fluffy.
Beat in the egg and vanilla extract until fully incorporated. Add the sourdough discard and mix just until combined. Scrape down the sides of the bowl as needed.
Combine wet and dry: With the mixer on low speed, gradually add the dry flour mixture to the wet ingredients. Mix until just combined—do not overmix.
Fold in the chocolate chips gently, ensuring they are evenly distributed.
Use a 1½ tablespoon cookie scoop to portion dough onto the prepared baking sheets, spacing cookies about 2 inches apart. (If you don’t have a cookie scoop, use two spoons to drop sticky dough onto the tray.)
Bake cookies for 9–11 minutes, or until the edges are set and the centers no longer look glossy.
Allow cookies to cool on the baking sheet for 5 minutes before transferring to a wire rack to cool completely.
Optional: While the cookies are still warm, press a few extra chocolate chips into the tops and sprinkle with flaky sea salt, if using.