Bring a large pot of salted water to a rolling boil. Add the spaghetti and cook until just al dente, about 8-10 minutes, stirring occasionally. Drain, reserving about ½ cup of pasta water, and set aside.
While the pasta cooks, peel and thinly slice the garlic cloves. Heat the olive oil in a large skillet over medium-low heat until it shimmers and releases a grassy aroma.
Add the sliced garlic to the hot oil. Sizzle gently, stirring often, until the slices turn golden and fragrant, about 2-3 minutes. Be careful not to burn the garlic, as it can turn bitter.
Sprinkle in the red pepper flakes if using, and cook for about 30 seconds until they crackle and release their aroma, enhancing the oil with a spicy kick.
Add the drained spaghetti to the skillet. Toss everything together quickly, ensuring the pasta is coated evenly with the fragrant garlic oil. If the mixture feels dry, add a splash of the reserved pasta water to loosen it up.
Cook for another 1-2 minutes, allowing the flavors to meld and the pasta to absorb the aromatic oil. Taste and adjust seasonings with salt as needed.
Remove from heat and stir in chopped parsley and lemon zest if desired, adding a fresh, bright note. Toss gently to distribute evenly.
Serve immediately, garnished with additional chili flakes or herbs if you like a bit more spice and freshness. Enjoy the fragrant, glossy pasta while hot!