For a tree T, consider its smallest subtree T∘ containing all vertices of degree at least 3. Then the remaining edges of T lie on disjoint paths each with one endpoint on T∘. We show that the chromatic symmetric function of T determines the size of T∘, and the multiset of the lengths of these incident paths. In particular, this generalizes a proof of Martin, Morin, and Wagner that the chromatic symmetric function distinguishes spiders.