Bring a large pot of salted water to a boil. Add the spaghetti and cook according to package instructions until al dente. Reserve 1/2 cup of pasta water, then drain the pasta and return it to the pot.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté for about 1 minute, or until fragrant but not browned.
Add the halved cherry tomatoes to the skillet. Cook for about 5-7 minutes, stirring occasionally, until the tomatoes start to soften and release their juices.
If you enjoy a bit of heat, sprinkle in the red pepper flakes and mix well. Season with salt and pepper to taste.
Add the cooked pasta to the skillet and toss to combine with the tomato mixture. If the pasta seems dry, add a splash of the reserved pasta water until you reach the desired consistency.
Stir in the fresh basil and cook for another minute until just wilted.
Serve hot, topped with grated Parmesan cheese if desired.