Preheat the oven to 350°F (175°C) and line baking sheets with parchment paper.
Whisk together the flour, cocoa powder, baking soda, and salt.
Beat the softened butter, brown sugar, and granulated sugar until creamy.
Beat in the eggs one at a time, followed by the vanilla.
Gradually mix the dry ingredients into the wet ingredients until just combined.
Fold in the chocolate chips, pecans, and caramel pieces.
Scoop approximately 2 tablespoons of dough per cookie onto the prepared baking sheets.
Bake for 9–11 minutes until the edges are set but the centers remain slightly soft.
Cool on the baking sheet for 5 minutes before transferring to a wire rack.
Sprinkle lightly with flaky sea salt if desired.