In a large pot of boiling salted water, cook the spaghetti according to package instructions until al dente. Reserve 1/2 cup of pasta water, then drain the pasta and set aside.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté for about 30 seconds until fragrant.
Add the shrimp to the skillet and season with salt and pepper. Cook for 2-3 minutes on each side or until the shrimp are pink and opaque.
Lower the heat and add the cooked pasta to the skillet with the shrimp. Toss in the pesto, cherry tomatoes, and a splash of the reserved pasta water to help combine everything. Mix until the pasta is evenly coated with the pesto.
Stir in the grated Parmesan cheese until melted and well incorporated. If the pasta seems dry, add more reserved pasta water as needed.
Remove from heat, plate the pasta, and garnish with fresh basil leaves and additional Parmesan if desired.
Notes
Feel free to use store-bought pesto for convenience.