Whisk the egg yolks, sugar, cornstarch, cocoa and salt together in a medium bowl and set aside. Bring the milk to a boil in a medium saucepan. Remove from the heat and whisk a little at a time into the egg mixture. Once the bottom of the bowl is warm, slowly whisk in the remaining hot milk. Pour the mixture back into a clean medium saucepan (cleaning the saucepan prevents the pudding from scorching), add the vanilla and whisk over medium-low heat until it thickens, 3 to 4 minutes. Cook while constantly whisking until the pudding is glossy and quite thick, 1.5 to 2 minutes longer. Transfer the pudding to a clean bowl.
Add the chopped chocolate and the butter and gently whisk until the chocolate is completely incorporated. Press a piece of plastic wrap onto the surface of the pudding to prevent a skin from forming. Refrigerate for 4 hours.
Before serving, whisk the pudding until it is soft and smooth, about 30 seconds. Divide into custard cups or martini glasses and serve, topped with broken pieces of peanut brittle (see recipe below). The pudding will keep in the refrigerator for up to 3 days, with plastic wrap intact.
For peanut brittle:
Heat the oven to 325 degrees. Grease a silicone baking sheet, a Silpat mat or the back of a rimmed baking sheet with 2 tablespoons of the butter and set aside. Line another baking sheet with parchment paper. Place the peanuts on top and roast until glossy and fragrant, 5 to 10 minutes. Remove from the oven and set aside.
Meanwhile, stir the sugar, corn syrup and water together in a heavy-bottomed pot or large saucepan. Cook over medium-high heat until the mixture reaches 300 degrees. Immediately remove from the heat and, using a heatproof rubber spatula or a wooden spoon, stir in the remaining 1 tablespoon of butter, vanilla, baking soda, salt and peanuts.
Immediately pour the hot mixture onto the prepared baking sheet and, using the spatula, spread it as thinly as possible. Cool for 30 minutes and then, using a rolling pin, the back of a metal spoon or your hands, break the brittle into rough, craggy pieces. The brittle will keep for up to a few weeks in an airtight container.