Make the cheesecake swirl: In a small bowl, beat the cream cheese, sugar, vanilla, and sour cream until smooth and creamy. Cover and chill while you make the cookie dough.
A short chill helps it hold its shape when swirled.
Whisk dry ingredients: In a medium bowl, whisk the flour, cocoa powder, cornstarch, baking soda, and salt. The cornstarch keeps the cookies soft.
Cream butter and sugars: In a large bowl, beat the butter, granulated sugar, and brown sugar until light and fluffy, about 2 minutes. Scrape the bowl as needed.
Add wet ingredients: Beat in the egg, vanilla, and peppermint extract until smooth.
Mix in the milk. The batter may look slightly loose; that’s fine.
Combine: Add the dry ingredients to the wet and mix on low until just combined. Fold in chocolate chips if using.
Do not overmix.
Chill briefly: Cover the dough and chill for 20–30 minutes. This makes scooping easier and helps prevent spreading.
Preheat and prep: Heat oven to 350°F (175°C). Line two baking sheets with parchment paper.
Scoop the dough: Use a medium cookie scoop (about 1 1/2 tablespoons) and place mounds 2 inches apart on the sheets.
Press a shallow well in the center of each mound with the back of a spoon.
Add the cheesecake swirl: Dollop about 1 teaspoon of the cheesecake mixture into each well. Use a toothpick or small knife to gently swirl it into the top of each cookie. Don’t over-swirl; two or three figure-8 motions are enough.
Top with candy canes: If using, sprinkle crushed candy canes lightly over the cheesecake swirl.
A pinch of flaky sea salt adds a nice pop, too.
Bake: Bake 10–12 minutes, until the edges are set and the centers look slightly soft. The cheesecake swirl should look glossy but not wet.
Cool: Let cookies cool on the sheet for 5 minutes, then transfer to a wire rack to cool completely. They’ll firm up as they cool and stay fudgy inside.