Cook the dried spaghetti in salted water and cook until al dente according to the package directions. Drain, reserving 1/4 cup (60 ml) pasta cooking water and transfer to a bowl. Set aside.
In a big pan, heat olive oil over medium heat. Stir in garlic and cook until fragrant. Add the chicken and cook until it is fully cooked. Add the cherry tomatoes and drained pasta. Turn off the heat. Add the pesto and reserved pasta water. Stir until well combined.
Divide the pasta into serving plates and top it with parmesan. Serve immediately.