Toast almonds in 400ยบ F oven until just browned. Cook the pasta or gnocchi according to package directions.
In a food processor, add the toasted almonds, garlic and pepper flakes. Pulse until coarsely ground. Add the tomatoes, basil and 3/4 teaspoon salt. Pulse until chunky.
In a small sauce pan, melt the butter over medium heat. Add the flour and stir together. Cook for 1 minute to release the flour taste, then slowly add in the milk. Let cook for 5 minutes over medium heat and slightly bubbling to thicken a bit. Add in the Parmesan and stir to combine. Let simmer for 10-15 minutes until well thickened.
Pour in the contents of the food processor and cook for 5 minutes. Add in cooked pasta or gnocchi. Serve with extra Parmesan, if desired.