The dough needs to chill overnight in the fridge so you’ll make it the day before you intend to bake them. They last a few days and can be made ahead of time.
Beat the butter with the sugar, salt, vanilla and baking soda for about 3-4 minutes, until very light and fluffy. Add the egg and beat for another couple of minutes until it’s well combined.
Add the cocoa and flour, and beat to just combine. Fold in the peanuts. Set the dough in an airtight container in the fridge overnight.
The next day, transfer it to the counter to soften a bit before you start shaping (at least 30 minutes).
Scoop the dough into 2 tablespoons of dough onto a cookie sheet lined with parchment paper.
Press the dough balls with your thumb to create a little ‘bowl’ shape. Set the caramel in the center and form the dough back into a ball, leaving a bit of the caramel exposed (see photos). Repeat with all the dough. Set the baking tray in the freezer.
Preheat the oven to 350. Ensure there’s about 2 inches between each cookie, giving them room to spread. Sprinkle with flaked sea salt if desired. Bake for 12 minutes.