In a medium bowl, whisk together the flour, cinnamon, baking soda, salt, and cornstarch. Set aside.
In a large mixing bowl, whisk the melted butter and brown sugar until smooth. Add the eggs one at a time, then mix in the vanilla extract.
Gradually stir the dry ingredients into the wet ingredients until just combined.
Fold in the oats, shredded carrots, raisins, and walnuts (if using). Mix until evenly distributed.
Cover the dough and refrigerate for 30 minutes to prevent spreading while baking.
Preheat the oven to 350°F (175°C) and line a baking sheet with parchment paper.
Scoop tablespoon-sized portions 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 and the centers look set.
Let the cookies cool on the baking sheet for 5 minutes before transferring them to a wire rack to cool completely.
If using cream cheese frosting, spread or drizzle over cooled cookies before serving.