Peel and devein the shrimp, keeping the shells. Pat the shrimp dry and refrigerate until needed.
Heat the oil in a 4-quart / 3.8L stockpot over medium heat. Add the shrimp shells and cook for 2 to 3 minutes, stirring, until pink and fragrant.
Pour in the water, bring to a boil, then lower the heat and simmer for 15 minutes to build a light shrimp stock.
Strain the stock through a fine-mesh sieve into a bowl, pressing on the shells to get every drop. Discard the shells and return the stock to the pot.
Add the lemongrass, galangal, kaffir lime leaves, and chilies to the stock. Simmer for 10 minutes so the broth picks up their aroma.
Add the mushrooms and tomatoes. Simmer for 3 to 4 minutes until the mushrooms soften and the tomatoes just start to break down.
Add the shrimp and cook for 2 to 3 minutes, until they turn opaque and curl into a loose C shape (145 F / 63 C). Don't walk away here, shrimp overcook fast and turn rubbery within another minute.
Remove the pot from the heat. Stir in the fish sauce, lime juice, and sugar. Taste and add more lime juice if you want it sharper.
Ladle into bowls and scatter with cilantro and green onion. Serve hot.