In a large pot, bring 2-3 quarts of water plus ½ tbsp of salt to a boil. Cook the spaghetti until al dente.
In a skillet, bring the garlic and oil to a boil over low heat. Cook for about 2-3 minutes or until the garlic is golden in color. Remove the garlic from the oil, set aside.
In the same skillet, stir in the anchovies, capers, and keep stirring for about 30 seconds on low heat. Add parsley, red chili pepper flakes (optional) and stir for a few seconds. Turn off the heat. Add pasta, and shredded parmesan cheese. Toss well to coat.
How to store: You can store the leftover cooked pasta in an airtight container. The leftover will last 3-5 days in the fridge or up to 2 months in the freezer.