Start by grating your carrots finely so they blend seamlessly into the dough. Soften your cream cheese by leaving it at room temperature for about 30 minutes. Preheat your oven to 350°F (175°C) and line your baking sheet with parchment paper.
In a small bowl, combine the softened cream cheese, powdered sugar, and 1/2 teaspoon vanilla extract. Beat together with a hand mixer or whisk until smooth and creamy. Set aside.
In a large mixing bowl, whisk together the granulated sugar, brown sugar, and vegetable oil until well combined. Add the eggs one at a time, beating after each addition. Stir in the vanilla extract.
In a separate bowl, sift together the flour, baking powder, baking soda, cinnamon, nutmeg, and salt. Gradually mix the dry ingredients into the wet ingredients until just combined. Fold in the grated carrots and chopped walnuts if using.
Drop rounded spoonfuls of cookie dough onto the prepared baking sheet, spacing them about 2 inches apart. Add a dollop of the cream cheese filling on top of each cookie dough mound. Using a toothpick or skewer, gently swirl the cream cheese into the dough to create a marbled effect.
Bake the cookies in the preheated oven for 12-15 minutes, or until the edges are lightly golden and the cream cheese swirl is set. Remove from the oven and allow the cookies to cool on the baking sheet for 5 minutes before transferring to a wire rack to cool completely.
Once cooled, these Carrot Cake Cream-Cheese Swirl Cookies are ready to serve. Store any leftovers in an airtight container at room temperature for up to 3 days or refrigerate for up to a week.