For the pesto: Combine the basil, pine nuts, crushed garlic clove, 1 teaspoon salt, and a few grinds of black pepper in a blender or food processor and pulse to make a coarse paste. Scrape down the sides. With the machine running, add ⅓ cup olive oil in a steady stream to make a smooth paste. Add the parmesan and pulse to incorporate. Set aside.
Bring a large pot of salted water to a boil. Add the spaghetti and cook according to the package directions for al dente. Reserve 1 cup cooking water, then drain the spaghetti.
Heat the remaining 2 tablespoons olive oil in a large skillet over medium-high heat. Add the asparagus and cook, tossing, until bright green, about 2 minutes.
Add the shrimp and season with the remaining ½ teaspoon salt and a few grinds of pepper. Cook, tossing, until the shrimp is just cooked through and the asparagus is just tender, 3 to 4 minutes. Add the chopped garlic and toss, about 30 seconds. Remove the skillet from the heat.
Add the spaghetti, pesto, and ½ cup of the reserved cooking water to the skillet and toss well to coat, adding up to ½ cup more cooking water if needed. Serve with parmesan.
