Boil the pasta. Bring a large pot of well-salted water to a rolling boil. Add the pasta and cook until just al dente according to package directions.
Reserve at least 3/4 cup of the starchy pasta water before draining.
Sauté the garlic. While the pasta cooks, warm 2 tablespoons olive oil in a large skillet over medium heat. Add the sliced or minced garlic and cook 30–60 seconds until fragrant. Don’t let it brown.
Cook the tomatoes. Add the halved cherry tomatoes and a pinch of salt.
Cook 3–5 minutes, stirring occasionally, until they start to soften and release some juices. They should be saucy but still hold their shape.
Season the base. Add black pepper and a pinch of red pepper flakes if using. If the pan looks dry, splash in a tablespoon of pasta water to keep things silky, not oily.
Combine pasta and tomatoes. Add the drained pasta to the skillet with the tomatoes.
Toss to coat, letting the pasta soak up some of the tomato juices, about 30 seconds.
Stir in the pesto. Off the heat or over very low heat, add 1/2 cup pesto. Loosen with splashes of hot pasta water, tossing until every piece is lightly coated. Add more pesto if you prefer a richer coating.
Add Parmesan and adjust. Sprinkle in the grated Parmesan and toss.
Add a little more pasta water as needed to keep the sauce creamy and glossy. Taste and adjust salt, pepper, and heat.
Finish with brightness. If you like, add a small squeeze of lemon juice or a little zest to lift the flavors. Toss in fresh basil leaves and toasted pine nuts for aroma and crunch.
Serve. Plate the pasta and top with extra Parmesan and a drizzle of good olive oil.
Serve immediately while warm and fragrant.