Crush 2 tablespoons of M&Ms in a zip-top bag with the bottom of a glass.
Combine melted butter, granulated sugar, dark brown sugar, egg, vanilla, and salt in a bowl.
Whisk vigorously until lighter in color and slightly thickened, about a minute.
Mix in baking soda, then add flour. Switch to a rubber spatula and gently mix until little flour is visible. Do not overmix.
Fold the M&Ms into the dough.
Cover and rest the dough in the fridge for 30 minutes to firm up slightly and develop the flavor.
Preheat the oven to 350° F (177° C).
Portion out 6 cookie dough balls using a 1¼-ounce cookie scoop (2 tablespoons or about 50 grams). Place them evenly apart on a parchment paper-lined baking sheet. Sprinkle some flaky salt on top.
Portion the rest for future baking if you are not baking it all at once. You can store them in the fridge for 3 to 5 days or up to 3 months in the freezer.
Bake for 10 minutes (plus or minus 1 minute, depending on your oven) until lightly golden around the edges and slightly underdone in the center. They will continue to bake as they sit on the baking sheet.
Sprinkle crushed M&Ms on top while the cookies are warm.