Place the cashews in a small bowl and cover with boiling water. Let soak until cashews are tender, 60 minutes.
Drain cashews and transfer to a blender with ½ cup fresh water and ¼ teaspoon salt. Blend until smooth. Set aside.
Bring a large pot of heavily salted water to a boil. Add pasta and cook until al dente, about 2-3 minutes less than the time indicated on the package. Reserve 1 ½ cups pasta cooking water.
Heat olive oil in a large pan over medium heat. Add chopped onions and cook until softened, 3-4 minutes. Add garlic and cook until fragrant, about 1 minute more. Add tomato paste and cook, stirring, until darkened in color, about 2 minutes. Then add diced tomatoes, red pepper flakes, remaining ½ teaspoon salt, and ½ cup reserved pasta water. Bring sauce to a simmer and cook until slightly thickened and darker in color, about 10 minutes.
While sauce is simmering, transfer pasta, cashew cream and remaining 1 cup of the pasta cooking water to the sauce and toss until the sauce coats the pasta well. Top with basil, and serve immediately.