Brush any dirt off the mushrooms, wipe gently with a damp cloth. Quarter them. Chop finely with a chef’s knife. You can use a food processor if you prefer
Melt butter in a pan over medium low heat. Add shallot and cook a minute or two until soft. Add garlic and cook one minute longer. Add mushrooms and cook until most of the moisture has released and mushrooms are almost dry. Stir in sherry (if using) and cook until liquid is about gone.
Add herbs, a little salt and pepper, stir until combined. Cool and refrigerate for 4-5 days or use immediately.