Bring a large pot of salted water to a boil and cook pasta according to package instructions. Reserve ½ cup of the pasta water before draining.
While the pasta cooks, heat olive oil in a large skillet over medium-high heat. Season the chicken with salt and pepper, then sauté until golden and cooked through, about 6–8 minutes. Remove from heat and set aside.
Reduce heat to low. In the same pan, add pesto and cream (if using). Stir until combined and heated through. Add a splash of reserved pasta water to thin out the sauce if needed.
Add the cooked pasta and chicken to the pan. Toss well to coat in the pesto sauce. Stir in Parmesan, cherry tomatoes, and spinach, if using. Cook for 1–2 more minutes until everything is warmed and the spinach is wilted.
Serve hot, garnished with extra Parmesan and fresh basil. Add red pepper flakes for a little kick, if desired.