Pre-heat the oven to 200°c , roast the pistachio nuts on a baking tray for aronud 5-6 minutes until a shade darker. Put aside to cool.
When cooled, put most of the pistachios, basil leaves (keep a few for garnish), grated cheese, garlic and olive oil into a blender or food processor. Whizz into a semi-smooth pesto.
Cook the pasta according to the instructions. Add the peas and the beans for the last three minutes. Drain well, reserving some of the cooking water.
Stir the pesto into the pasta, with the chilli flakes, capers, lemon juice and zest. Add some of the cooking water if needed. Check for seasoning.
Serve the pasta with remaining nuts (roughly chopped), shaved/grated parmesan, and basil leaves scattered over.