Cook the pasta in generously salted water until al dente, then drain.
In a 9x13-inch baking dish, add the pasta, pesto, garlic, parmesan, chili flakes, salt, pepper, heavy cream, and spinach. Mix with a wooden spoon until everything is well combined.
Sprinkle the mozzarella evenly over the top.
Bake for 20 minutes, until the cheese is melted and lightly golden.
Serve on its own or with your favorite protein or salad.
Notes
Cook the pasta al dente: it keeps cooking in the oven, so slightly firm pasta bakes up tender instead of mushy. Leftover cooked pasta works great too.
Salt the pasta water generously: it seasons the pasta itself, not just the sauce.
Don’t rinse the pasta: the starch on the surface helps the creamy sauce cling to it.
Drain well and use dry spinach: extra water makes the bake watery.
For a golden top: broil for the last 2 to 3 minutes, watching closely so the cheese doesn’t burn.
Make ahead: assemble, cover, and refrigerate for up to 1 day, then bake a few minutes longer.
Storage: refrigerate for up to 3 days or freeze for up to 2 months. Reheat in a 180°C (350°F) oven or the microwave.