Crush two 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.
Stir 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 six cookie dough balls using a 1¼-ounce cookie scoop (two 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 three to five days or up to three months in the freezer.
Bake for 10 minutes (plus or minus one 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.