Chop up the onion and mince the garlic to get started.
In a large skillet, add the olive oil, onion, garlic, and anchovy filets. Cook everything over medium heat, stirring now and then, until the onions turn soft and the anchovies melt right into the mix.
Next, pour in the crushed tomatoes and toss in the basil, red pepper flakes, sliced olives, and capers. Give it all a good stir, then let the sauce come to a gentle simmer.
Once it starts bubbling, lower the heat and let it simmer away, stirring every so often while you get the pasta going.
Bring a big pot of water to a boil. Once it’s rolling, drop in the spaghetti and cook it until it’s perfectly tender—about 7 minutes.
Before draining, scoop out about 1/2 cup of that starchy pasta water and set it aside.
Now, add the drained spaghetti to the skillet with the puttanesca sauce. If your skillet isn’t big enough, combine everything back in the large pot with the heat off.
Stir it all together until the pasta is nicely coated in sauce. If it seems a little dry, just add a splash or two of the reserved pasta water to loosen things up.
Serve hot and enjoy!