Sift the flour, cocoa and baking soda together. Working with a stand mixer, preferably fitted with a paddle attachment, or with a hand mixer in a large bowl, beat the butter on medium speed until soft and creamy. Add both sugars, the salt and vanilla extract and beat for 2 minutes more.
Turn off the mixer. Pour in the flour. Drape a kitchen towel over the stand mixer to protect yourself and your kitchen from flying flour, and pulse the mixer at low speed about 5 times, a second or two each time. Take a peek — if there is still a lot of flour on the surface of the dough, pulse a couple of times more; if not, remove the towel.
Continuing at low speed, mix for about 30 seconds more, just until the flour disappears into the dough — for the best texture, work the dough as little as possible once the flour is added, and don’t be concerned if the dough looks a little crumbly. Toss in the chocolate pieces and mix only to incorporate.
Turn the dough out onto a work surface, gather it together and divide it in half. Working with one half at a time, shape the dough into logs that are 1½ inches in diameter. Wrap the logs in plastic wrap and refrigerate them for at least 3 hours.
(The dough can be refrigerated for up to 3 days or frozen for up to 2 months. If you’ve frozen the dough, you needn’t defrost it before baking — just slice the logs into cookies and bake the cookies 1 minute longer.)