Special equipment: a muffin tin with 12 (1/2-cup) muffin cups
Preheat oven to 400 degrees F.
Prepare mushrooms: Cook mushrooms and shallot in butter with salt and pepper in a large heavy skillet over moderately high heat, stirring, until mushrooms are tender and liquid they give off is evaporated, about 10 minutes. Remove from heat and stir in creme fraiche and tarragon.
Assemble: Fit 1 slice of ham into each of 12 lightly oiled muffin cups (ends will stick up and hang over edges of cups). Divide mushrooms among cups and crack 1 egg into each. Bake in middle of oven until whites are cooked but yolks are still runny, about 15 minutes. Season eggs with salt and pepper and remove (with ham) from muffin cups carefully, using 2 spoons or small spatulas.
The eggs in this recipe are not fully cooked, which may be of concern if salmonella is a problem in your area.