Preheat oven to 350°F (175°C) and line a baking sheet with parchment paper.
Whisk together flour, baking soda, baking powder, salt, cinnamon, and nutmeg.
In another bowl, cream butter, brown sugar, and granulated sugar until light and fluffy.
Beat in egg and vanilla extract until combined.
Mix in grated carrots.
Gradually add dry ingredients and mix until just combined.
Fold in nuts and raisins if using.
Scoop tablespoon-sized dough onto prepared baking sheet.
Bake for 12–14 minutes until edges are lightly golden.
Cool on baking sheet for 5 minutes, then transfer to a wire rack to cool completely.