Soak the noodles in room-temperature tap water for 30 to 40 minutes, until they bend easily but still feel firm in the middle. Drain well. They will finish cooking in the pan, so do not use hot water.
Mix the tamarind paste, fish sauce, palm sugar and chili flakes in a small bowl. Stir until the sugar mostly dissolves. Taste it: it should be sour, salty and sweet in roughly equal measure, and stronger than you would eat on its own.
Pat the shrimp dry. Heat a large wok or nonstick skillet over high heat with 1 tbsp oil. Sear the shrimp in a single layer for about 60 seconds per side until just pink. Move them to a plate.
Add another 1 tbsp oil to the pan, then the tofu. Fry 2 to 3 minutes, turning once or twice, until golden on a couple of sides. Add the garlic and shallot and stir for 20 seconds.
Push everything to one side. Add the last 1 tbsp oil to the empty side, crack in the eggs and scramble them gently until about 80 percent set, then fold into the tofu.
Add the drained noodles and the sauce. Toss constantly over medium-high heat for 2 to 3 minutes. If the noodles are still stiff, add a splash of water (2 to 3 tbsp) and keep tossing until they are tender and have soaked up the sauce.
Return the shrimp with half the bean sprouts and all the chives. Toss for 30 seconds, just until the chives wilt. Turn off the heat.
Serve topped with the remaining raw bean sprouts, crushed peanuts and a lime wedge. Squeeze the lime over the noodles at the table.