Cream the butter and sugar. In a mixing bowl, beat the softened butter and granulated sugar until light and fluffy, about 2–3 minutes.
Scrape the sides once or twice to keep things even.
Add yolk and extracts. Beat in the egg yolk, vanilla, and almond extract (if using) until smooth and cohesive.
Mix in the sourdough discard. Add the discard and blend until fully incorporated. The mixture may look slightly curdled—this is normal. Keep going.
Combine dry ingredients. In a separate bowl, whisk together flour, baking powder, and salt.
Add to the wet mixture and stir just until no dry spots remain. Don’t overmix.
Chill the dough. Cover and chill for 30–45 minutes. Chilling helps prevent spreading and makes shaping easier.
Prep the oven and pans. Heat the oven to 350°F (175°C). Line two baking sheets with parchment.
Shape the cookies. Scoop 1-tablespoon portions and roll into balls.
If using nuts or coconut, roll the balls in the coating now. Place on the sheets, spacing about 2 inches apart.
Make the thumbprints. Use your thumb or the back of a small measuring spoon to press a deep well into each ball. If the edges crack, gently pinch them back together. Re-press if needed—the well should be clear and round.
Fill with jam. Stir the jam to loosen it, then spoon about 1/2 to 3/4 teaspoon into each well.
Don’t overfill; jam will spread as it heats.
Bake. Bake 11–13 minutes, rotating the pans halfway through. The edges should be set and just starting to color, and the jam should look glossy and slightly bubbling.
Reshape (if needed) and cool. If the wells puff, gently nudge them back with a spoon right out of the oven. Cool on the sheet for 5 minutes, then transfer to a rack to finish cooling.
Dust and serve. Once fully cool, dust lightly with powdered sugar if you like.
The texture sets as they cool—tender centers, crisp edges, jammy middles.