Combine the clams and 1 cup water in a Dutch oven over medium-high heat. Cover and cook until they start to open, about 5 minutes. Use tongs or a slotted spoon to transfer the clams to a bowl; discard any unopened clams. Pour the clam juices into a liquid measuring cup (avoid the sediment from the bottom of the pot). Wipe out the pot. Cover the clams to keep warm.
Add the olive oil to the pot and set over medium-high heat. Add the onion, diced fennel, a big pinch of salt and a few grinds of pepper. Cook, stirring occasionally, until the vegetables are softened, about 8 minutes. Add the tomatoes and red pepper flakes; cook, stirring, until mostly dry, about 2 minutes. Add enough water to the clam juices to equal 3 cups, then add the liquid to the pot, cover and bring to a boil.
Meanwhile, trim the green beans and cut into 1-inch pieces. Add to the pot along with the pasta and cannellini beans and their liquid. Bring to a boil, then reduce to a simmer and cook, stirring occasionally, until the pasta is al dente, 8 to 10 minutes. Add more water, if needed; season with salt and pepper. Stir in the clams and heat through.
Divide the soup among bowls. Top with chopped fennel fronds and the pesto.