Grind the coriander seeds into powder using a spice grinder or mortar and pestle.
Combine the ground coriander, shallots, garlic, tamarind paste, sugar, and salt in a food processor (or large mortar). Grind until it forms a consistent paste.
Scrape the paste into a large nonstick skillet and add the shredded coconut. Heat skillet over medium heat, stirring frequently to mix thoroughly and prevent scorching.
When the skillet and its contents are hot, add the ginger and lemongrass and stir well. Continue stirring and cooking until the coconut is well browned and the mixture becomes dry. This can take as long as 20 minutes. It will take less time if you are using dried coconut instead of fresh.
Store or serve immediately