Boil water in a large pot. Salt generously. Cook pasta until al dente, according to package directions.
While pasta cooks, heat olive oil in a skillet over medium heat. Add sliced garlic and chili flakes. Sauté 1–2 minutes until the garlic is fragrant and barely turning golden.
Reserve a cup of pasta water, then drain the pasta. Do not rinse. You want that starch for the sauce.
Toss the hot pasta into the skillet with the garlic oil. Add a splash of the reserved pasta water to loosen the sauce.
Squeeze in lemon juice if using. Season with salt and pepper. Toss vigorously to coat every strand.
Remove from heat, stir in parsley (if using) and finish with grated cheese. Serve immediately.