Preheat your oven to 350°F (175°C) and line a baking sheet with parchment paper.
In a mixing bowl, cream together the butter and brown sugar until light and fluffy.
Add the egg and vanilla extract, and mix until well combined.
In another bowl, whisk together the flour, baking powder, cinnamon, and salt.
Gradually add the dry ingredients to the wet ingredients, mixing until just combined.
Fold in the grated carrots and walnuts (if using).
Drop spoonfuls of dough onto the prepared baking sheet, spacing them about 2 inches apart.
Bake for 10-12 minutes, or until the edges are golden brown.
Allow the cookies to cool on the baking sheet for a few minutes before transferring to a wire rack to cool completely.