Whisk together all-purpose flour, baking powder, and salt in a medium bowl and set aside.
In a large bowl, beat softened butter and granulated sugar until light and fluffy, about 2 to 3 minutes.
Add egg, vanilla extract, and peppermint extract to the creamed butter mixture and mix until combined.
Gradually incorporate the dry ingredients into the wet mixture until a soft dough forms.
Divide the dough in half, leaving one half plain and coloring the other half with red gel food coloring.
Wrap both dough portions in plastic wrap and refrigerate for 30 minutes to firm up.
Roll small portions of red and plain dough into six-inch ropes, twist them together, and bend the top to shape candy canes.
Place shaped cookies on a parchment-lined baking sheet and bake at 350°F (175°C) for 10 to 12 minutes until edges are set but not browned.
Let cookies cool on the baking sheet for 5 minutes, then transfer to a cooling rack.
While still warm, sprinkle crushed candy canes or sugar on top if desired.