Heat the oil in a frying pan over medium heat. Add the mustard seeds and allow them to pop. Stir in the dried red chili and curry leaves and cook for about 30 seconds until fragrant.
Add the sliced onions, pinch of salt, and cook for about 8 minutes, stirring occasionally until they begin to soften.
Add the diced tomato and continue cooking until the tomato breaks down.
Sprinkle in the turmeric powder, chili flakes, Kashmiri chili powder, and salt. Mix well so the onions are evenly coated with the spices.
Add the sliced green chili and Maldive fish flakes if using.
Continue cooking over medium-low heat, stirring frequently, until the onions become soft, lightly caramelized, and reduced in volume.
Recipe note: If at any point during cooking, the onions starts to burn the bottom or smoke, reduce the heat to low and add a tbsp of oil.