Heat olive oil in a skillet over medium heat. Add unpeeled garlic cloves (prevents burning, keeps flavor mild) and finely chopped shallots. Sauté until soft.
Add halved cherry tomatoes and basil leaves. Stir, cover, and cook for 15 minutes on medium heat.
Uncover, season with salt, and cook for 5 more minutes.
Strain through a sieve for a smooth tomato sauce.
Return sauce to the skillet. If too thick, add a splash of reserved pasta water to adjust consistency.
Add cooked spaghetti and a few fresh basil leaves.
Toss and cook for 1 minute.
Serve hot, topped with grated Parmesan if desired.