Season the shrimp with the salt and pepper. Heat the olive oil in a large skillet over medium-high until it's glistening and just barely moving in the pan. Add the shrimp in a single layer. Work in batches so they sear instead of steam, you never want to crowd them — and cook, flipping once, until pink and just opaque, about 2–3 minutes per side. Remove to a bowl.
12 oz shrimp, 1 tsp kosher salt, Freshly ground black pepper, 3 tbsp olive oil
Add the butter to the same pan and let it foam and turn nutty for a few seconds. Add the tomatoes. They should sizzle and glisten right away, that's the fond (brown stuff on the bottom of the pan) doing its job!
1 tbsp unsalted butter, 2 cups cherry or grape tomatoes
While the tomatoes cook, bring a large pot of generously salted water to a boil and cook the spaghetti to al dente. Reserve 1 cup pasta water before draining.
12 oz spaghetti, Kosher salt, 1 cup reserved pasta water
Add 2–3 tbsp pasta water to the tomatoes and scrape up any browned bits from the bottom of the pan — that's flavor, not mess. Continue cooking over medium heat until the skins blister and start to split, about 5–7 minutes, using the back of a spoon to help the stubborn ones along. The pan should smell like summer and the tomatoes will be sitting in their own juice. Transfer them and every drop of that juice to the bowl with the shrimp; set aside.
(Skip this step if you are using store bought pesto) Make the pesto: in a food processor, combine the basil, pine nuts, garlic, a pinch of salt, Parmigiano, and Pecorino. Process until finely chopped. With the motor running, stream in the olive oil until the pesto turns vibrant green and smooth.
3/4 cup fresh basil leaves, 1 garlic clove, 6 tbsp pine nuts, 3/4 cup grated Parmigiano Reggiano, 6 tbsp grated Pecorino Romano, 1/2 cup extra virgin olive oil, Pinch of salt
Add the pesto to the same pan you used to cook the shrimp and tomatoes — don't wipe it out, that fond and those tomato juices are the sauce base. Add the 1/2 cup water and whisk to combine; the sauce will loosen and turn glossy almost immediately.
1/2 cup water
Add the cooked spaghetti, then the shrimp and tomatoes with their juices. Use tongs to toss until every strand is coated and glossy, adding more reserved pasta water as needed to keep the sauce silky, not tight.
Take the pan off the heat and squeeze in the lemon juice, then toss once more. You must do this off the heat. It keeps the acid bright instead of cooking it flat.
1/2 lemon
Serve immediately, topped with grated Parmesan and torn basil.
Grated Parmesan, Torn basil