Boil the pasta: Bring a large pot of salted water to a boil. Cook pasta until just shy of al dente.
Reserve 1 cup pasta water, then drain.
Season the chicken: Pat dry and season generously with salt and pepper. Add a pinch of red pepper flakes if you like heat.
Sear the chicken: In a large skillet over medium-high heat, add olive oil and butter. Cook chicken in a single layer, 3–5 minutes per side, until golden and cooked through.
Transfer to a plate.
Sauté aromatics: Lower heat to medium. In the same skillet, add shallot and garlic. Cook 30–60 seconds until fragrant, stirring to avoid burning.
Build the sauce: Stir in cream and bring to a gentle simmer.
Whisk in pesto and Parmesan until smooth. Add lemon zest and juice. Season to taste.
Combine: Return chicken to the skillet with any juices.
Add the drained pasta and toss to coat. If using spinach or peas, stir them in now.
Adjust texture: Add splashes of reserved pasta water until the sauce is glossy and clings to the pasta.
Finish and serve: Taste and adjust salt, pepper, and lemon. Top with extra Parmesan and torn basil.
Serve warm.