Heat olive oil in a wide sauté pan over medium heat.
Add the smashed garlic and anchovy fillets. Cook gently until the anchovies dissolve into the oil and the garlic becomes lightly golden, about 1–2 minutes.
Add the ciliegini tomatoes, then stir in the olives and capers.
Season with salt, black pepper, and a pinch of red pepper flakes.
Lower the heat and let the sauce simmer uncovered for 8–10 minutes, until slightly thickened and glossy.
Meanwhile, bring a large pot of salted water to a boil and cook the spaghetti until al dente. Reserve pasta water before draining.
Add the spaghetti directly to the sauce.
Add a ladle of reserved pasta water and the chopped parsley.
Toss continuously over medium heat until the sauce coats the pasta and everything comes together.
Serve immediately.