Put the flour, baking powder, salt, and cayenne in a food processor. Whiz for a second to blend. Dump in the butter and whiz again until the butter is in small (pea-size) pieces. Add the cheeses, whiz, and finally add the egg and pulse until the mixture just starts to come together.
Dump out on a work surface. Sprinkle the nuts onto the pile of dough. Knead by lightly smearing the ingredients together by pushing them away from you with the heel of your hand (this is called fraisage). Shape the dough into a flat disk, wrap in plastic, and chill for an hour or two to let the butter firm up. You can keep the dough in the fridge for 2 days or freeze for a few months (if frozen, thaw in the refrigerator overnight before use).
Heat the oven to 400°F. On a lightly floured surface, roll out the dough until it's about 1/4 inch thick. Stamp out shapes or cut shapes with a knife. Put the shapes on an ungreased baking sheet. Reroll the scraps and stamp again.
Brush with the glaze and sprinkle with more salt. Bake in the hot oven until golden brown and thoroughly cooked inside, about 14 minutes. To test, break one in half and look; if the center is still light and doughy, bake for a few more minutes. Cool on a rack and store only when completely cool.