Prep the basics: Heat the oven to 350°F (175°C). Line two baking sheets with parchment paper.
Set butter out if it’s not already soft.
Whisk the dry ingredients: In a medium bowl, whisk flour, cocoa powder, baking soda, salt, and espresso powder until evenly combined.
Cream the butter and sugars: In a large bowl, beat the softened butter with granulated and brown sugar on medium speed for 2–3 minutes, until light and fluffy.
Add eggs and flavorings: Beat in the eggs one at a time, then add vanilla and peppermint extract. Start with a modest amount of peppermint; you can always add a tiny bit more to taste.
Combine the dough: Add the dry ingredients to the wet in two additions, mixing on low just until combined. Do not overmix.
Fold in chocolate chips or chunks.
Scoop: Use a medium cookie scoop (about 1.5 tablespoons) to portion dough onto prepared sheets, spacing about 2 inches apart.
Bake: Bake 9–11 minutes, until the edges look set and the centers are slightly soft. They’ll continue to firm up as they cool.
Top while warm: Immediately sprinkle a little crushed candy cane over each cookie so it adheres. Let cookies cool on the sheet for 5 minutes, then transfer to a rack.
Finish (optional): Once cool, dip half of each cookie in melted dark or white chocolate, then add a bit more crushed peppermint.
Let set before storing.