Bring a large pot of water to a rolling boil and add a generous amount of salt, then add the spaghetti and cook until al dente according to package directions.
While the pasta cooks, heat the olive oil in a large skillet over medium to medium-low heat.
Add the thinly sliced garlic to the oil and stir constantly until the garlic is just golden and fragrant, being careful not to burn it.
Stir in the red pepper flakes, then remove the skillet from the heat.
When the pasta is done, reserve at least 1/2 cup of the cooking water and drain the spaghetti.
Transfer the hot pasta to the skillet with the garlic oil, add at least 1/2 cup of the reserved pasta water, and toss thoroughly to coat; add more pasta water as needed to create a silky sauce.
If using, add the chopped parsley and grated Parmesan and toss lightly to combine.
Serve immediately.