Preheat the oven to 400°F. Pierce the potatoes all over with a fork and bake directly on the rack until very tender, about 50 to 60 minutes.
While still warm, peel the potatoes and mash them with a fork (or pass them through a ricer) onto a clean work surface. Spread them out on a baking sheet so the steam can escape. Let them air-dry for 10 minutes. They should feel bone-dry to the touch.
Sprinkle the salt and pepper over the potatoes. Drizzle the beaten egg evenly across the surface.
Add the flour over the potatoes and gently fold everything together with your hands or a bench scraper until a soft dough just comes together. Stop mixing the second it holds.
Lightly flour the counter. Divide the dough into 4 portions and roll each into a rope about 3/4 inch thick. Cut into 1 inch pieces.
If desired, roll each piece gently over the tines of a fork to create ridges. Place the shaped gnocchi on a lightly floured tray.
Bring a large pot of well-salted water to a gentle boil. Add the gnocchi in batches (about 15 pieces at a time). Once they float to the surface, cook 30 seconds more, then remove with a slotted spoon to a colander. Scoop out 1/2 cup of the cooking water and reserve it for the sauce.
For Butter Sauce
Melt the butter in a wide skillet over medium-low heat until foamy but not browning.
Add 1/2 cup of the reserved starchy water to the butter and swirl the pan vigorously for 15 to 20 seconds, until the sauce turns opaque, glossy, and slightly thickened. This is the emulsion forming.
Add the cooked gnocchi to the pan and swirl to coat every piece in the sauce.
Pull the pan off the heat, wait 10 seconds, then sprinkle in the Parmesan and gently toss until melted into the sauce. Taste and add a pinch of salt if needed. Scatter the parsley or thyme over the top and serve immediately in warm bowls, with extra Parmesan.
Video
Notes
Potatoes: Russets are best because they are high in starch and low in moisture. Avoid waxy potatoes like Yukon Gold or red, which make dense, gummy gnocchi. Baking instead of boiling keeps excess water out of the dough.Flour: The exact amount varies based on potato moisture. Use just enough flour for the dough to hold together without sticking to your fingers. Too much flour makes heavy gnocchi.
If the dough sticks to your fingers, sprinkle in another tablespoon of flour at a time until it just holds. If it feels dry or crumbly and won't come together, dab on a teaspoon of beaten egg or water and fold once more.
Handling: Overworking develops gluten and turns the texture chewy. Mix gently and stop the moment a soft dough forms (a few extra folds is all it takes to turn it gummy).Sauce rescue: If the butter sauce looks oily or breaks at any point, pull it off the heat and add a splash more cold pasta water while swirling. The starch will pull it back into a glossy emulsion.Make ahead: Shape the gnocchi and freeze in a single layer on a tray. Once solid, transfer to a freezer bag and cook straight from frozen, adding about 1 extra minute to the cooking time.Serving: Butter sauces do not reheat well. Sauce only what you are serving that night and toss leftover plain gnocchi in a little olive oil to re-sauce fresh the next day.