Put the oil, star anise, cinnamon stick, bay leaf, teaspoon cloves, garlic clove, shallot, and Szechuan peppercorns in a small pot, and turn the heat to medium high.
When the oil temperature reaches 200ºF – there should tiny bubbles coming to the surface – let the ingredients infuse the oil for the 30-40 minutes. Keep an eye on the temperature (it’s okay if it goes up to 220-230) and ingredients to make sure they are burning too quickly (getting dark in color).
Set a glass or ceramic bowl down and place a strainer on top of it. Turn the heat off and carefully strain the oil through a sieve, into the bowl. Discard the ingredients that are left in the strainer.
Add the Chinese chili flakes and salt and gently stir to mix. Let the chili oil cool down to room temperature and transfer it to an airtight storage container.
How to store chili oil: Keep this homemade chili oil in a cool dark place. It will keep for up to 4 months.