01 - Preheat oven to 350°F. Line two baking sheets with parchment paper.
02 - In a medium bowl, whisk together flour, cinnamon, nutmeg, baking soda, and salt. Set aside.
03 - In a large bowl, beat butter, brown sugar, and granulated sugar until light and fluffy. Add egg and vanilla extract; mix until combined.
04 - Gradually add dry ingredients to wet ingredients, mixing just until incorporated.
05 - Fold in grated carrots, oats, and, if using, nuts and raisins.
06 - Drop rounded tablespoons of dough onto prepared baking sheets, spacing about 2 inches apart.
07 - Bake 11–13 minutes or until edges are set and tops look dry. Cool on the baking sheets for 5 minutes, then transfer to a wire rack to cool completely.
08 - Beat cream cheese and butter until smooth. Add powdered sugar and vanilla; beat until fluffy.
09 - Once cookies are completely cool, spread or pipe a dollop of frosting onto each cookie. Optionally, sprinkle with extra chopped nuts.