Grate the carrots using the shredding disk of a food processor or on the large holes of a box grater (the Rösle Coarse Grater is our favorite)Do not use packaged preshredded carrots..
For The Carrot Cookies
Adjust oven racks to upper-middle and lower-middle positions and heat oven to 350 degrees. Line 2 baking sheets with parchment paper. Combine carrots, ½ teaspoon granulated sugar, and ⅛ teaspoon salt in bowl. Transfer carrots to a fine mesh sieve placed over a bowl and let sit for 30 minutes.
Place carrots in center of clean dish towel, gather ends of towel to form bundle, and twist to remove as much moisture from carrots as possible (you should squeeze off about ⅛ cup liquid).
Whisk flour, cinnamon, baking soda, cocoa powder, and ⅛ teaspoon salt together in bowl. brown sugar, melted butter, egg and yolk, vanilla, and remaining 4 tablespoons granulated sugar in separate large bowl until fully combined. Stir flour mixture into butter mixture until just combined.
Stir in carrots, walnuts, and raisins.
Drop 2-tablespoon portions of dough onto prepared sheets, staggering 6 portions on prepared baking sheet. (Distribute any remaining dough evenly.)
Using your fingers, lightly press cookies to even ¾-inch thickness. Bake cookies until edges are set and beginning to brown, 16 to 20 minutes. Let cookies cool on sheets for 5 minutes. Transfer cookies to wire rack and let cool completely before frosting.
For The Frosting
Using stand mixer fitted with paddle, beat butter and sugar on medium speed until light and fluffy, about 2 minutes. Add cream cheese, 1 piece at a time, beating after each addition, until fully incorporated. Add vanilla and mix until no lumps remain.
Spread about 1 - 2 tablespoons frosting on flat side of half of the cooled cookies, leaving a ¼-inch border. Place remaining cookies, flat side down, on top of cream cheese frosting, pressing lightly to push frosting to edges of cookies. Cover and refrigerate util ready to serve. Let stand at room temperature for 10 minutes to soften slightly before serving.
Notes
Expert Tips for Perfect Carrot Cookies
• Squeeze those carrots well → This is the difference between cookies and cake• Use melted butter → Adds chew and structure• Don’t overbake → Edges should be set, centers soft• Flatten before baking → Helps control spread• Cool fully before frosting → Prevents frosting from melting