Cream softened butter with both sugars until light and fluffy. Mix in the egg and vanilla extract until smooth.
In another bowl, whisk flour, baking soda, baking powder, salt, cinnamon, and nutmeg. Slowly mix into the wet ingredients just until combined.
Fold in shredded carrots. Stir in chopped nuts and raisins if using.
Line a baking sheet with parchment paper. Scoop tablespoon-sized portions of dough 2 inches apart.
Bake at 350°F (175°C) for 10–12 minutes, until edges are golden and centers are set
Let cookies rest on the baking sheet for 5 minutes, then transfer to a wire rack to cool completely.
Beat softened cream cheese and butter until smooth. Gradually add powdered sugar, then mix in vanilla until fluffy.
Spread or pipe frosting on fully cooled cookies. Serve right away or chill until ready to enjoy.