Drain the noodles. For the sauce: mix all the ingredients in a small saucepan over med-high heat and simmer until sugar has dissolved.
Heat oil in a wok or big pot over medium heat and fry shallots until softened. Crack in egg and stir. Mix in tofu, shrimp, and chili flakes. Stir fry until tofu is thoroughly heated through and then add noodles. Turn up heat and stir fry until noodles get softer, translucent, and brown in color. Add the prepared sauce and a pinch of chili flakes. Stir for just a few moments. Do not overcook. Finally, add most of the bean sprouts and chives and cook for another 30 seconds.
Top the noodles with crushed peanuts, green onion, bean sprouts, cilantro, lime juice, and chili flakes.