Fresh pesto should never be "cooked". Heat will change the flavor profile and turn the basil into a dark, muddy black color. To keep the vibrant freshness of pesto, stir it into the pasta off the heat. The heat from the pasta is enough to warm the pesto without applying direct heat.