Boil the pasta. Bring a large pot of well-salted water to a boil.
Add pasta and cook until al dente according to package directions. Before draining, reserve 1 cup of pasta water.
Toast the walnuts. While the pasta cooks, warm a dry skillet over medium heat. Add walnuts and toast for 3–4 minutes, stirring often, until fragrant and lightly golden.
Let cool slightly.
Start the pesto base. In a food processor, add toasted walnuts, garlic, lemon zest, and a pinch of salt. Pulse until finely chopped.
Add the greens and cheese. Add spinach (and any optional basil or parsley), Parmesan, and a few grinds of black pepper. Pulse a few times to break it down.
Stream in olive oil. With the processor running, pour in 1/3 cup olive oil.
Scrape the sides and check the texture. Add more oil as needed to reach a creamy, scoopable consistency.
Balance the flavors. Add lemon juice to taste—start with 1 tablespoon and adjust. Season with more salt and pepper as needed.
If it’s too thick, blend in a splash of pasta water.
Combine with pasta. Return the drained pasta to the pot. Add the pesto and 1/4 cup pasta water. Toss over low heat until the sauce coats the noodles.
Add more pasta water as needed to create a glossy, silky sauce.
Finish and serve. Taste and adjust seasoning. Serve with extra grated cheese, a drizzle of olive oil, and a pinch of red pepper flakes if you like.