Prep your pan and oven. Line two baking sheets with parchment paper.
Preheat the oven to 350°F (175°C).
Combine the wet ingredients. In a large bowl, whisk the melted butter with the brown and granulated sugars until smooth and glossy. Add the egg and vanilla, and whisk until the mixture looks thick and slightly lighter. Stir in the sourdough starter until fully combined.
Whisk the dry ingredients. In a separate bowl, whisk the flour, cocoa, baking soda, salt, and espresso powder (if using).
Break up any cocoa lumps with your whisk.
Bring it together. Add the dry ingredients to the wet ingredients. Use a spatula to fold until just combined. Stop as soon as no dry streaks remain.
Add the chocolate. Fold in the chopped chocolate or chips.
The dough will be soft and glossy.
Optional rest for better texture. For thicker cookies with richer flavor, cover and chill the dough for 30–60 minutes. If you’re short on time, you can bake right away; they’ll spread a bit more but still taste great.
Scoop and top. Scoop 2-tablespoon mounds (about 35–40 g each) onto the prepared sheets, spacing them 2 inches apart. If you like a salty finish, sprinkle a few flakes of sea salt on top.
Bake. Bake for 9–11 minutes, until the edges are set and the centers look slightly underbaked and soft.
Rotate the pans halfway if your oven runs hot on one side.
Pan bang (optional). For crinkly edges, gently bang the tray on the counter once right after baking. This helps collapse the centers for a fudgy texture.
Cool. Let the cookies rest on the sheet for 5 minutes, then transfer to a rack. They’ll firm up as they cool.