Heat the olive oil in a large skillet over medium heat. Add the shallots and cook, stirring occasionally, until caramelized and jammy, about 15-20 minutes. If the shallots start to stick or burn, reduce the heat and add a splash of water.
Add the minced garlic, red pepper flakes, tomato paste, and anchovies to the skillet. Cook for another 2 minutes, stirring constantly, until the garlic is fragrant.
Cook the pasta according to package instructions until al dente. Reserve 1 cup of the pasta cooking water.
Transfer the cooked pasta to the skillet with the shallot mixture. Add about ½ cup of the reserved pasta cooking water and toss until the pasta is well coated. Add more pasta water as needed to create a sauce-like consistency.
Serve the caramelized shallot pasta with grated Parmesan cheese and chopped fresh parsley. Enjoy!
