Fill a large pot with water, add a generous pinch of salt, and bring to a rolling boil.
Add the spaghetti or linguine and cook until al dente according to package directions.
Reserve 1 cup of the starchy pasta water, then drain the pasta.
In a large skillet over medium heat, heat the olive oil.
Add the sliced garlic and sauté until fragrant, about 1 minute, taking care not to brown it.
Pour in the crushed tomatoes, add salt, black pepper, and red pepper flakes, stir, and bring to a gentle simmer.
Reduce heat to low and simmer the sauce for 10–15 minutes, stirring occasionally.
Add the drained pasta directly to the skillet and toss to combine.
Add 1/4 cup of the reserved pasta water and the chopped fresh basil, tossing until the pasta is well coated; add more pasta water if the sauce is too thick.
Stir in the grated Parmesan cheese until it melts into a creamy sauce.
Serve immediately with extra grated Parmesan cheese on top, if desired.