Marinate chicken pieces with turmeric powder and salt. Set aside for 15 minutes.
In a dry pan, roast whole turmeric, coriander seeds, black peppercorns, fenugreek seeds, cumin seeds, garlic pod, and both varieties of dry red chillies until fragrant and aromatic.
Allow roasted spices to cool completely, then grind them with sliced onions, grated coconut, tamarind, and water to form a smooth paste.
Heat ghee in a heavy-bottomed pan and sauté the remaining sliced onions until golden brown.
Add the ground masala paste to the pan and cook for 5-7 minutes, stirring continuously.
Add marinated chicken pieces along with salt and mix well to coat with the masala.
Add thin coconut milk and bring to a boil. Cover and cook for 20-25 minutes until chicken is tender.
Stir in thick coconut milk and simmer for 2-3 minutes. Garnish with curry leaves if using.
Serve hot with steamed rice or neer dosa.