Bring a large pot of salted water to a boil. Cook the spaghetti according to package instructions until al dente. Reserve about 1 cup of pasta water, then drain the pasta.
In a large skillet over medium heat, add the olive oil and sliced garlic. Cook gently until the garlic is golden and fragrant, about 3-4 minutes, making sure not to burn it.
Add the red pepper flakes to the skillet and stir for about 30 seconds to infuse the oil.
Once the spaghetti is drained, add it directly to the skillet with the garlic and oil. Toss to coat evenly.
Add the lemon zest, lemon juice, and chopped parsley, tossing everything together well. If the pasta seems too dry, add some reserved pasta water, a little at a time, until you reach your desired consistency.
Season with salt to taste, and give the dish one last toss to mix everything thoroughly.
Serve immediately, garnished with Parmesan cheese shavings if desired.
Notes
Adjust red pepper flakes to taste for desired spiciness.