Preheat your oven to 400°F (200°C). In a medium baking dish, add the cherry tomatoes, olive oil, garlic, salt, pepper, and red pepper flakes. Toss gently to coat. Nestle the block of feta right in the center of the dish, surrounded by the tomatoes.
Drizzle a little more olive oil over the top of the feta — this helps it roast evenly and develop that creamy texture. Bake for about 30–35 minutes, until the tomatoes have burst and the feta looks soft and slightly golden around the edges.
While the feta and tomatoes bake, bring a large pot of salted water to a boil. Add the pasta and cook according to package instructions until al dente. Before draining, reserve about ½ cup of the pasta water — you’ll use it to loosen the sauce later. Drain and set aside.
Once the feta and tomatoes are done baking, remove the dish from the oven. Use a fork to mash the feta and tomatoes together right in the dish. Add the cooked pasta to the dish, along with a splash of the reserved pasta water. Stir everything together until the pasta is coated in that creamy, tangy sauce.
Add the chopped basil (and spinach if you’re using it), and stir again. The heat from the pasta will wilt the greens perfectly.