No, you don't need to cook the pesto before putting it in the pasta. Just add all of the ingredients for the pesto to a food processor and pulse until it is smooth. Then, add it to the cooked and cooled pasta.