Add the oil and shallots to a medium, heavy-bottomed saucepan set over medium heat. When oil begins to bubble, lower the heat to medium-low and let the shallots gently simmer, stirring occasionally, until they soften and just barely start to color, about 25 minutes.
Add the garlic and star anise and continue to cook, stirring often, until the shallots and garlic turn light golden brown, about another 10 to 15 minutes. You can raise the heat just a little if they don't brown at all. Keep a careful eye on the pot because the garlic and shallots can scorch.
While the shallots are cooking, add the ginger, pepper flakes, Sichuan pepper, cumin, MSG, soy sauce, sugar and peanuts to a medium heat-proof bowl. Set a fine mesh sieve on top of the bowl.
When the shallots and garlic are lightly golden, carefully pour the hot oil through the sieve into the bowl with the pepper flakes, straining out the solids. Spread the garlic and shallots out on a paper towel-lined plate and allow them to cool completely (they won’t fully crisp until they cool), about 20 minutes. Discard the star anise.
Once the oil mixture and shallots have both fully cooled, mix the crispy shallots and garlic into the bowl. Transfer the finished chili crisp into clean glass jars and store in the refrigerator for about 3 months. It can be used immediately, but for the best flavor, let it sit for one day. Stir well before serving.