In a small saucepan, melt the butter over medium heat. Cook for several minutes to brown the butter. It will go from simmering to bubbling to foaming, and you will begin to see brown flecks on the edges of the pan and the bottom. It will smell nutty and delicious. Once you can see a good amount of brown specks, remove from heat and pour butter and scrape all the bits into your mixing bowl that you will use for the cookies.
Add sugars and stir to coat. Then add sourdough discard and stir to incorporate a bit. Then add egg and switch to a whisk, whisking mixture until it is cohesive. Add vanilla and whisk again.
In a bowl, whisk together flour, baking powder, baking soda, and salt. Add half the flour mixture to the wet mixture, and stir with a spatula, about 15 times. Then add remaining flour and stir gently to incorporate, until almost all the flour is absorbed, but not quite. We want to avoid overworking the dough, so add the chopped chocolate now, and finish mixing the dough.
Cover and refrigerate for 30 minutes. When 30 minutes is up, preheat your oven to 375 degrees F. Prepare a sheet pan with parchment paper, and scoop 55 gram dough balls. I usually bake 7 cookies at a time.
Bake for about 13 minutes, until edges are a little bit brown and middles are just set. Do not overbake. Remove from oven and tap the pan on the counter firmly two times, this deflates the cookie a bit and gives you the gooeyness. Let cookies cool on pan for 5 minutes. They will finish baking here. Then move cookies to a wire rack to cool. Top with a light sprinkle of flaky salt.
