In a large mixing bowl, beat the softened butter and powdered sugar with an electric mixer for 2–3 minutes until smooth and fluffy. Add the egg, vanilla extract, and almond extract, then mix until everything is well combined.
In a separate bowl, whisk together the flour and salt. Gradually add the flour mixture to the butter mixture, mixing on low speed until a soft dough forms. Add the green food coloring and mix until the color is evenly distributed. Fold in the chopped pistachios if using.
Cover the dough and refrigerate for 30 minutes to 1 hour. Chilling helps the dough stay firm, making the fingers easier to shape and less likely to spread during baking.
Preheat the oven to 350°F and line two baking sheets with parchment paper. Divide the dough into small portions and roll each into a finger-shaped log about 3 inches long. Pinch the dough slightly around the middle to create knuckles.
Press an almond firmly into one end of each cookie to create a fingernail. Use a small knife or toothpick to make shallow horizontal lines at the knuckles. Arrange the cookies on the prepared baking sheets, leaving space between them. Freeze for 15 minutes for better shape retention.
Bake for 10–14 minutes, or until the cookies are set and the edges are just beginning to turn lightly golden. Avoid browning them too much if you want a pale, spooky appearance. Let them cool on the baking sheet for 5 minutes before transferring them to a wire rack.
Once the cookies have cooled slightly, carefully lift each almond fingernail. Add a small dab of raspberry or cherry jam underneath and press the almond back into place. For an extra-creepy effect, brush a little jam around the base of the fingers. Let the cookies cool completely before serving.