If you’re baking the cookies on the same day you prepare the batter, heat the oven to 350 degrees and position a rack in the center of the oven.
Combine 4 ounces unsweetened chocolate, 5 ounces bittersweet chocolate, and the butter in a metal bowl and melt over a pot of simmering water, stirring occasionally, until completely melted. Remove from the heat and whisk in the vanilla extract.
Using a stand mixer fitted with a whisk attachment or an electric hand mixer, whisk together the sugar and eggs for about 5 minutes, until light and thick and pale yellow. With the mixer on low speed slowly add the melted chocolate and butter and mix for about 15 seconds. It will not be completely well mixed at this point—that’s okay because you will finish combining all of the ingredients by hand.
In a separate bowl, stir together the flour, baking soda, cream of tartar, salt, espresso powder, 2 ounces shaved unsweetened chocolate, 4 ounces chopped bittersweet chocolate, and toasted walnuts in a medium bowl. Remove the mixing bowl from the mixer, add the dry ingredients, and fold these in by hand until the batter is completely homogenous.
For best results, scrape dough into an airtight container and let it rest in the refrigerator overnight (or at least 3 to 4 hours) before baking. The next day, heat the oven to 350 degrees and position a rack in the center of the oven.
Drop the dough in 1/4-cup scoops onto a baking sheet about 2 inches apart. Bake for about 15 minutes, until the cookies are cracked on top and soft but not liquidy when you press them in the middle. Remove the cookies from the oven and let them cool for 10 to 15 minutes on the sheet, then remove the cookies from the sheet and let them continue cooling on a wire rack.
The cookies can be stored in an airtight container at room temperature up to 3 days. The unbaked dough can be stored for up to 1 week in an airtight container in the refrigerator.