Preheat oven to 400°F (200°C). Lightly grease a 9×13 inch baking dish.
Cook pasta in a large pot of boiling salted water for 2 minutes less than package directions, ensuring it is just under al dente. Drain and set aside.
Heat olive oil in a large skillet over medium high heat. Season chicken pieces with salt and pepper, then sauté until cooked through and lightly golden, about 5-6 minutes. Remove from heat and set aside.
In the same skillet, melt butter over medium heat. Add minced garlic and sauté for 30 seconds until fragrant.
Stir in heavy cream and whole milk, then bring to a gentle simmer for 2-3 minutes until slightly thickened.
Mix in basil pesto and grated Parmesan, stirring until smooth and melted. Adjust seasoning with salt and pepper to taste.
Return cooked chicken, drained pasta, and spinach (if using) to the sauce. Toss thoroughly until all ingredients are evenly coated.
Transfer the coated mixture into the prepared baking dish. Evenly sprinkle shredded mozzarella and extra Parmesan cheese over the top.
Bake uncovered for 20-25 minutes until cheese is golden and bubbly. Keep an eye around 18 minutes if your oven runs hot.
Allow dish to rest for 5 minutes before serving to help the sauce thicken.
Notes
This dish freezes and reheats well, making it great for meal prep. Use homemade or store-bought pesto based on your convenience.