Preheat the oven to 375°F. Line a baking sheet with parchment paper.
In a large bowl or stand mixer, cream the butter and sugar until light and fluffy, about 3 minutes.
6 tbsp unsalted butter, ¾ cups granulated sugar
Add the egg, zucchini, and lemon juice. Mix just until combined.
1 large egg, ¾ cups zucchini, unpeeled, grated, 1 tsp lemon juice
In a separate bowl, whisk together the flour, lemon zest, baking powder, baking soda, and salt.
1 ⅔ cups all-purpose flour, 1 tbsp lemon zest, ½ tsp baking powder, ¼ tsp baking soda, ¼ tsp salt
Add the dry ingredients to the wet ingredients and mix just until combined. Fold in walnuts if using.
1 cup walnuts
Drop tablespoon-sized portions of dough onto the prepared baking sheet about 2 inches apart. The dough will be quite soft and sticky.
Bake for 9–10 minutes, or until the cookies have spread slightly, the tops no longer look wet, and the edges are just lightly golden.
Let the cookies cool completely before glazing or frosting.