Make the pistachio pesto by combining pistachios, sun-dried tomatoes, garlic, basil, crushed red pepper flakes (if using), and a pinch of black pepper in a food processor or blender; pulse until coarsely chopped.
With the machine running, slowly add 2 tablespoons olive oil and process until smooth, then add the Parmesan and pulse until combined; taste and season with salt and more pepper if needed. Set aside.
Bring a large pot of salted water to a boil and cook the gnocchi according to package instructions; before draining, reserve 1 cup of the cooking water, then drain the gnocchi completely.
Heat 2 tablespoons olive oil in a large skillet over medium-high heat. Add the drained gnocchi in a single layer (work in batches if needed) and cook undisturbed until golden and crisp on the first side, about 3–4 minutes.
Turn the gnocchi and continue cooking, turning occasionally, until golden and crisp on all sides, about 3 more minutes per batch; remove from heat.
Toss the crispy gnocchi with the pistachio pesto, adding reserved cooking water a little at a time to thin the sauce to your desired consistency; stir until evenly coated.
Serve warm and garnish with additional basil and Parmesan if desired.