Combine the basil leaves, garlic cloves, chopped walnuts, grated cheese, and salt in your food processor. Pulse in short bursts until the mixture is finely minced, stopping occasionally to scrape any ingredients from the sides back into the bowl. Taste and add more salt as needed. Transfer to a clean bowl and set aside. (recipe note #1)
Cook the Pasta
Meanwhile, bring a large pot of generously salted water to a rolling boil. Add the pasta and cook until al dente (tender but still firm when bitten), about 8 minutes or according to package directions. Before draining, scoop out 1 cup of the starchy cooking water and set aside (you'll need this to create the perfect sauce consistency).
Prepare the Shrimp
While the pasta is cooking, melt the butter in a large skillet over medium-high heat until it begins to sizzle. Add the garlic and red pepper flakes, stirring constantly for about 30 seconds until fragrant but not browned. Add the shrimp to the skillet and cook, stirring occasionally, until they just turn pink and opaque throughout, about 2-3 minutes. Remove the skillet from heat once the shrimp are just cooked through.
Finishing the Dish
Return the skillet with the shrimp mixture to medium-low heat. Add the drained pasta, pesto, and 1/4 cup of the reserved pasta water. Gently toss everything together until well combined and heated through. If the mixture seems dry, gradually add more pasta water until you reach your desired consistency.
Transfer to platter or serving bowl and garnish with parsley and more grated parmesan cheese if desired; serve immediately.
Video
Notes
If making pesto in advance, pour a thin layer of olive oil over the surface to prevent browning. The oil creates an air barrier that preserves the bright green color. Store in an airtight container in the refrigerator for up to 5 days.