Brown the butter. Place the butter in a saucepan over medium heat. Let it melt, then continue cooking, stirring or swirling frequently. The butter will foam before the milk solids at the bottom begin to brown. Once those bits are deep golden and the butter smells nutty, immediately pour it into a large mixing bowl, scraping in all the browned bits. Cool for 10 to 15 minutes, until warm but not piping hot.
Mix the sugars, yolks, and discard. Whisk the brown sugar and granulated sugar into the slightly cooled butter. Add the egg yolks and vanilla and whisk until smooth and glossy. Add the discard and whisk thoroughly, breaking up any clumps, until it’s fully incorporated.
Make the dough. In a separate bowl, whisk together the flour, baking soda, baking powder, and kosher salt. Fold the dry ingredients into the butter mixture until mostly combined. Add the chocolate chips and continue folding just until the dough comes together and no dry flour remains.
Check the texture. The dough should be thick and scoopable but still soft, not dry or crumbly. If it’s very loose, fold in additional flour one tablespoon at a time. Keep in mind that the dough will firm up in the refrigerator.
Scoop and chill. Portion the dough into balls (I used a 2 tbsp cookie scoop) and place them in a covered container or on a covered tray. Refrigerate for 30 to 60 minutes for same-day baking, or 12 to 24 hours for deeper flavor. You can bake the dough immediately after a short chill. After an overnight chill, let the dough balls sit at room temperature for about 15 minutes to soften slightly.
Top and bake. Preheat the oven to 350°F. Arrange the dough balls on a parchment-lined baking sheet with plenty of space between them. Press a few pieces of chopped chocolate onto the top of each ball, then press one larger shard into its center. Bake for 10 to 12 minutes, adding a little time for larger cookies, until the edges are set and lightly golden while the centers still look slightly soft.
Cool on the pan. Leave the cookies on the hot baking sheet for 8 to 10 minutes before transferring them. Sprinkle with flaky sea salt while warm, if desired.