Scrub the clams, discarding any that stay open when handled. Cook them covered over high heat until the shells open, removing clams as they open.
Remove clams with a slotted spoon, keeping the juices in the pan as undisturbed as possible. Detach the meat, swish each clam in the pan juices to rinse away sand, and chop larger clams into 2 or 3 pieces. Put clams in a bowl, pour 2 tbsp olive oil (30 ml) over them, cover tightly, and set aside. Do not refrigerate.
Line a strainer with paper towels and filter the clam juices into a bowl. Set aside.
Use a broad skillet that can hold the pasta later. Add 3 tbsp olive oil (45 ml) and sliced garlic over medium-high heat. Stir just a few seconds without letting garlic color, then add parsley and chili. Stir once or twice, add diced tomato, cook 1 to 2 minutes, then add wine and simmer 20 to 30 seconds. Turn off heat.
Boil pasta in abundant salted water until very firm to the bite, barely short of fully cooked. It should be slightly stiff with a narrow chalk-white core.
Turn heat to high under the skillet, drain pasta and transfer it immediately to the pan. Add all filtered clam juice and cook, tossing, until the juice has evaporated. If it still needs more cooking after the juice is gone, add a small amount of water.
Before turning off the heat, add the clams with their oil and the basil. Toss 2 or 3 times, transfer to a warm platter, and serve at once.