Heat the olive oil in a medium skillet over medium heat. Add the onion and cook until soft and translucent, about 5 to 6 minutes. Add the garlic and cook for about 1 minute until fragrant.
Stir in the tomatoes, crushing them gently with a spoon. Simmer for 5 to 7 minutes until the sauce thickens slightly. Season with salt and chili flakes.
Use a spoon to make four small wells in the sauce. Crack an egg into each well.
Cover the skillet and cook until the egg whites are set but the yolks are still runny, about 5 to 7 minutes depending on preference.
Finish with Parmesan and fresh basil. Serve immediately with plenty of crusty bread.
Notes
If you like a thicker sauce, let the tomatoes simmer an extra minute or two before adding the eggs.
Keep the heat gentle once the eggs go in. Low and steady gives you tender whites and jammy yolks.
This is best eaten right away, but leftover sauce is incredible spooned over pasta or reheated with fresh eggs the next day.