Bring a large pot of salted water to a boil and add the spaghetti, cooking according to package directions until al dente. While the pasta cooks, mince the garlic cloves finely and chop the parsley and basil. Zest the lemon and juice it into a small bowl. This mise en place ensures everything is ready when you need it.
When the spaghetti is tender, drain it in a colander but reserve 1/2 cup of the starchy pasta cooking water in a separate bowl or measuring cup—this liquid is essential for creating a silky sauce that clings to the pasta. Set the drained pasta aside.
Heat the olive oil in a large skillet over medium heat. Once shimmering, add the minced garlic, chopped parsley, and red pepper flakes, stirring constantly for about 1 minute until fragrant but not browned—you want to infuse the oil with flavor without burning the garlic. I find that this brief blooming of aromatics in oil creates a much more flavorful base than adding them later.
Add the lemon zest, lemon juice, and salt to the skillet, stirring to combine. Then add the reserved pasta cooking water and the cooked spaghetti from Step 2, tossing everything together over medium heat for about 1 minute. The starchy pasta water helps emulsify the oil and creates a creamy coating—I always make sure to toss continuously so the pasta absorbs the flavors evenly.
Remove the skillet from heat and immediately stir in the freshly grated Parmesan cheese until it melts into the pasta, creating a silky sauce. Season with freshly ground black pepper to taste. Divide the pasta into serving bowls and garnish with the chopped fresh basil and additional Parmesan cheese if desired.