In the bowl of a stand mixer fitted with the paddle attachment, beat the butter until creamy, about 30 seconds.
1 cup unsalted butter
Add the cream cheese and mix until smooth. Add the sugar and beat on medium speed until fluffy.
4 ounces cream cheese, 1⅓ cups granulated sugar
Mix in the egg yolk, peppermint extract, and salt until fully combined. Gradually add the flour on low speed and mix just until incorporated.
1 large egg yolk, 2 teaspoons peppermint extract, ½ teaspoon salt, 3½ cups all-purpose flour
Divide the dough in half. Leave one half plain, and tint the other half with red gel food coloring until evenly blended.
Red gel food coloring
Roll out each dough half separately between two sheets of parchment paper into rectangles about ¼ inch thick, 5 inches wide, and 18 inches long. If the dough is too soft, chill briefly to make it easier to handle.
Chill both rolled dough sheets for 10 minutes. Stack the red dough on top of the plain dough and gently roll with a rolling pin to press them together into a ½-inch-thick rectangle. Wrap in plastic wrap and refrigerate for 45 minutes, or until firm.
Cut the chilled dough crosswise into ½-inch-wide strips, about 5 inches long. Roll each strip gently between your hands to round the edges, then twist into a spiral. Curve one end to form a candy cane shape and place on a parchment-lined baking sheet.
Repeat with the remaining dough, chilling again if it becomes too soft.
Preheat the oven to 350°F (180°C). While heating, place one tray of shaped cookies in the freezer for a few minutes to firm up.
Bake for 7–8 minutes, until set but not browned. Allow to cool before serving.