Bring a large pot of salted water to a boil. Add the 250g of spaghetti and cook according to package instructions until al dente (about 8-10 minutes). Once cooked, drain the spaghetti in a colander and reserve a cup of pasta water for later.
In a large skillet, heat 2 tablespoons of olive oil over medium heat. Add the crushed or finely chopped garlic and sauté for about 1 minute until fragrant, being careful not to burn it.
Stir in the chopped anchovies and cook for another 2-3 minutes, allowing them to dissolve into the oil and impart their flavor into the dish.
Pour in the 400g tin of peeled chopped tomatoes, along with half of the chopped flat-leaf parsley, the chopped basil leaves or basil pesto, and the capers. Stir well to combine all the ingredients.
Add the chopped black olives and the dried chili flakes or fresh red chili to the sauce. Let it simmer for about 10 minutes, allowing the sauce to thicken slightly. If it becomes too thick, add a bit of the reserved pasta water to reach your desired consistency.
Add the cooked spaghetti to the sauce in the skillet and toss to combine, ensuring every strand is coated in the rich sauce. Cook for another minute or so, allowing the spaghetti to absorb some of the sauce flavors.
Plate the spaghetti puttanesca and garnish with the remaining chopped parsley. If desired, sprinkle with freshly grated Parmesan cheese and some finely chopped fresh tomato. Enjoy your delicious meal!