Preheat the oven to 400°F (200°C).
In a baking dish, add cherry tomatoes, minced garlic, and olive oil. Season with salt, pepper, and chili flakes if desired. Mix well.
Place the block of feta cheese in the center of the dish, surrounded by the tomatoes. Drizzle with a bit of olive oil.
Bake for 30 minutes, or until the tomatoes are soft and the feta is golden and bubbly.
Meanwhile, cook the pasta according to package instructions. Reserve 1/2 cup of pasta water before draining.
Once the feta and tomatoes are baked, mash everything together with a fork to create a creamy sauce.
Add the cooked pasta to the dish and mix well. Use reserved pasta water to adjust the consistency of the sauce if needed.
Garnish with fresh basil leaves and serve warm.