Cook the pasta according to package instructions. Once cooked, drain and set aside, reserving 1/2 cup of pasta water.
- In a large skillet, heat olive oil over medium heat. Add the chopped onion and sauté for 2-3 minutes until softened. Add the minced garlic and cook for another 30 seconds until fragrant.
- Add the halved cherry tomatoes (or canned diced tomatoes) and cook for 5-7 minutes, stirring occasionally, until the tomatoes start to soften and release their juices.
- Stir in the cooked lentils and cook for another 2 minutes to warm them through. If the mixture seems too dry, add a splash of the reserved pasta water to loosen it up.
- Add the cooked pasta to the skillet, tossing it to combine with the tomato and lentil mixture. Stir in the balsamic vinegar (if using), fresh basil, and red pepper flakes (if desired). Season with salt and pepper to taste.
- Remove from heat and gently stir in the crumbled feta cheese, allowing it to melt slightly into the pasta and create a creamy texture.
- Serve hot, garnished with extra basil or a sprinkle of additional feta if desired.