Heat the oil in the base of a tagine or a large, heavy-based saucepan over a medium heat, stir in the onions, garlic and sugar and cook for 3–4 minutes until they begin to soften and colour. Stir in the chilli flakes and the dried sage leaves and cook for a further 1 minute.
Use a wooden spoon to create 4 wells in the onion mixture and crack the eggs into them. Cover and cook over a medium heat for a further 3–4 minutes until the whites of the eggs are firm. Season with salt and pepper and serve immediately on toasted flat breads or with a dollop of thick yogurt, if liked.