Reduce heat to medium low. Melt the butter in the same pot and use a silicone spatula to clean the chicken bits from the bottom. This is called “fond” and it gives the sauce a nice flavor.
Add the onions and cook until softened, about 4 minutes. Add the garlic and cook for 1 minute.
Sprinkle flour over the onions and toss to coat. Cook for 2 minutes, until you can no longer smell flour.
Add the chicken broth in splashes to maintain the thickness of the roux. Stir in between each splash. Add the milk next, a little bit at a time. Whisk until combined and smooth.
(Now is a good time to start boiling the water for the pasta. Cook it according to package instructions and drain once finished.)
Meanwhile, let the sauce simmer and reduce while the pasta water heats up. Add the softened cream cheese and stir continuously until melted and smooth. This is more difficult if the cream cheese is cold.
Reduce heat to low and let the base cool a bit. Sprinkle in the shredded cheddar and stir to combine.
If you’d like to thin the sauce out at all, add a little bit of the juice from the diced tomatoes, otherwise, drain the juice and add the tomatoes along with the chicken. Stir to combine.
Stir in the spaghetti. If you’re not using an oven-safe pot, transfer to a lightly greased 9x13 casserole dish.