Preheat your oven to 350°F (175°C). Lightly grease a 9x13-inch baking dish with cooking spray or a dab of butter to prevent sticking.
Boil the spaghetti in salted water until al dente (about 8–9 minutes), then drain and set aside. Avoid overcooking—it will continue to soften in the oven.
In a large mixing bowl, stir together the cream of chicken soup, sour cream, mozzarella cheese, Parmesan cheese, chicken broth, garlic powder, onion powder, and a pinch of salt and pepper. Mix until smooth and creamy.
Fold the shredded chicken and cooked spaghetti into the sauce mixture. Mix thoroughly to ensure every strand of pasta is well-coated.
Pour the mixture into your prepared baking dish and spread it evenly. Press down lightly with a spatula to level it out.
In a small bowl, combine the crushed Ritz crackers and melted butter until crumbly. Sprinkle this topping generously over the entire casserole.
Bake uncovered in the preheated oven for 25–30 minutes, or until the top is golden brown and the edges are bubbly. The center should be hot and gooey.
Let the casserole rest for 5–10 minutes before serving.