Soak the tamarind pulp in 4 tablespoons water for 10 to 20 minutes. Squeeze the pulp, then strain through a sieve and discard the seeds.
Prepare the crabs: clean, halve and separate the claws.
Heat the oil in a large wok and fry the ground paste until fragrant, about 2 minutes.
Add the tomatoes, 125 ml water, ketchup, salt and strained tamarind, then the crabs. Cover and cook 8 to 10 minutes.
Taste and add more salt if needed; if too spicy, add the sugar.
Add the beaten egg and gently mix for about 20 seconds until wispy, then turn off the heat.
Garnish with coriander and chives. Serve with rice.