Preheat convection oven to 350°F (177°C) and line two baking sheets with parchment paper. In a medium bowl, whisk together the flour, baking soda, cinnamon, ginger, nutmeg, kosher salt, and freshly cracked pepper. Set aside.
Place carrots between two paper towels and gently press to remove a little moisture. Do not fully dry them out, as a small amount of moisture is what keeps the cookies tender.
In a large bowl, beat the butter, brown sugar, and granulated sugar until light and fluffy. Add the egg and vanilla extract and mix until combined. Mix in the grated carrots just until combined. Gradually add the dry ingredients, mixing on low speed until no dry streaks remain. Fold in the nuts if using.
Scoop the dough into rounded tablespoon portions and space them about 2 inches apart on the prepared baking sheets. Gently flatten each mound slightly with your fingers. Bake for 12–14 minutes, until the edges are set and the centers still look soft. Let the cookies cool on the baking sheet for 5 minutes, then transfer to a wire rack to cool completely.
To make the filling, beat the cream cheese and butter together until smooth. Add the confectioners’ sugar, vanilla extract, and salt, and beat just until creamy and spreadable. Avoid overmixing to keep the filling light and not overly sweet.
Once the cookies are completely cool, pair up cookies of equal size and shape. Then spread or pipe a generous layer of filling onto the flat side of half the cookies. Top with the remaining cookies, pressing gently to create sandwiches.