Boil a large pot of water, salted to where it tastes "like the sea". (This will be WAY more than you think, but remember that most of the water gets poured down the drain. This enables you to season the food from within, so as not to require much additional salt later on.)
In a large frying pan over medium heat, add olive oil, onion root ends, and parsley sprigs. Add as many clams/mussels as will fit in a single layer, pour over 1 cup wine, cover and turn heat up to high. Let steam for 3-4 minutes, until clams/mussels have opened. (Tap any stubborn clams that won't open, but if they didn't open initially and don't respond to a tap, throw them away.) Turn down heat while moving clams/mussels with tongs to a bowl.
Repeat step 2 with remaining clams/mussels, adding more wine as needed.
While additional clams/mussels are cooking, separate cooked clam/mussel meat from shells (reserving a few that are intact for aesthetic).
Repeat step 2 (adding more wine as needed) and repeat step 4.
When clams/mussels are finished cooking, strain cooking liquid through a fine mesh strainer, discarding onion roots and parsley sprigs, and add strained liquid to the bowl where clams/mussels meat are resting.
Rinse the pan and return to stove, heating 1 tbsp olive oil over medium-high heat.
Add diced onion with a pinch of salt and cook ~10 minutes until translucent.
Meanwhile, cook the pasta until just al dente (the pasta will finish cooking in the sauce).
Add garlic and chili flakes to onions, letting garlic sizzle but not burn.
Add splash of clam/mussel cooking liquid to onions & garlic and let reduce.
Return clams/mussels to pan (reserving cooking liquid) and stir to combine. Add another 1/2 cup of cooking liquid.
Add cooked pasta directly to pan with clams/mussels and add another 1/2 cup cooking liquid, allowing pasta to continue cooking in the sauce and to soak up all of the brininess.
Squeeze juice of 1/2 lemon into sauce and stir to combine. Taste and adjust acid if needed, with more white wine or lemon juice.
Add 3 tbsp butter and stir to combine.
Distribute amongst plates and serve topped with fresh parsley and additional chili flakes.