In a pot of salty water, cook your spaghetti according to the package instructions.
In a deep pan, over medium heat, melt your butter.
Add in your shrimp in a single layer. Sprinkle with a pinch of salt. You will see their tails start to curl and they will start to turn pink in color. Cook for about 30-60 seconds on each side. Shrimp cook extremely fast so it's important to watch them. You will want to take them out about 5 seconds too early because they will finish cooking once they are added back into the pan.
Remove the shrimp out of the pan and set aside.
Add in your pesto and your cooked spaghetti, toss.
Ladle in 1-2 ladles of hot pasta water to make the sauce.
Add back in your shrimp and toss.