Cook the beans in a pot of lightly salted water until fork-tender, 3 minutes. Drain the beans and leave in the colander.
In the same pot, bring the chicken broth to a boil.
Add the chicken and simmer until cooked through, 15 to 20 minutes. Reserve ½ cup of the broth; refrigerate or freeze the remainder for another use. Shred the chicken.
Meanwhile, cook the spaghetti according to the package directions.
Heat the oil in a large skillet over medium heat. Add the garlic and cook for 1 minute.
Add the reserved broth, beans, pasta, chicken, crushed red pepper, and ½ teaspoon salt. Cook for 2 minutes. Stir in the basil.