Bring a large pot of water to a boil and season generously with salt. Cook the spaghetti according to the package directions until al dente, usually about 8–10 minutes depending on the pasta.
Before draining the pasta, reserve about ½ cup of the starchy cooking water. This helps create a silky sauce that coats the spaghetti instead of leaving the oil sitting separately.
While the pasta cooks, heat the olive oil in a large skillet over medium-low heat. Add the sliced garlic and gently cook for 3–5 minutes, stirring frequently, until the garlic becomes lightly golden and fragrant.
Be careful not to brown the garlic too much. Overcooked garlic can become bitter and overpower the delicate flavor of the dish.
Add the red pepper flakes to the garlic oil and cook for about 30 seconds to release their flavor.
Transfer the drained spaghetti directly into the skillet with the garlic-infused oil. Add a splash of reserved pasta water and toss continuously until the oil and water combine into a glossy coating.
Continue tossing the pasta for 1–2 minutes, adding more pasta water as needed until the sauce lightly clings to every strand.
Remove the skillet from heat and stir in fresh parsley, black pepper, and vegan Parmesan or nutritional yeast if using.
Add lemon juice for a fresh, bright finish, then taste and adjust seasoning with additional salt or red pepper flakes.
Serve immediately with extra parsley, vegan Parmesan, and a drizzle of olive oil if desired.