Cook the spaghetti in boiling water for 10–12 minutes, or according to the packet instructions. Drain and keep hot. Meanwhile, crush the olives with the side of a large knife; remove the stones and finely chop.
Heat the oil in a large nonstick frying pan over medium heat. Sauté the garlic until golden, 3 minutes. Stir in the tomatoes, capers, anchovies and chilli powder. Cook, stirring, until the sauce thickens slightly, 10 minutes. Stir in the olives.
Add the spaghetti to the sauce in the frying pan and toss to coat well. Sprinkle with the parsley and serve.