Start the water to cook your pasta, according to package instructions. (cook pasta to "almost done" not too soft.
While the water is starting, heat the olive oil in a large fry pan over medium-low heat.
Add the onion, garlic and red pepper flakes and cook till the onions have softened not browned about 8 minutes.
Add the tomato paste and beans to the onion-garlic mixture.
Add 1/2 to 3/4 cup of the pasta water to the sauce mixture and combine well.
Stir in 1/4 cup of the pesto, combine and add salt to taste.
Add the drained pasta to the mixture. Cook till hot and pasta is done(3-5 minutes).
Garnish with remaining pesto and enjoy!