Begin by cooking the spaghetti according to the package instructions in salted boiling water until al dente. Reserve 1 cup of pasta water, then drain the pasta.
In a large skillet, heat olive oil over medium heat. Add minced garlic and sauté until fragrant, about 1 minute.
Lower the heat and add the cream cheese to the skillet, stirring continuously until melted and combined with the garlic.
Gradually pour in the heavy cream while stirring to create a smooth sauce. Allow it to simmer for a few minutes until slightly thickened.
Stir in the grated Parmesan cheese until fully melted and then season with salt, pepper, and red pepper flakes (if using).
Add the cooked spaghetti to the sauce, tossing well to coat. If the sauce is too thick, gradually add reserved pasta water until the desired consistency is achieved.
Gently fold in the halved cherry tomatoes and cook for another minute to warm them through.
Serve immediately, garnished with fresh basil and a sprinkle of additional Parmesan cheese if desired.
Notes
Adjust the thickness of the sauce with reserved pasta water as needed.