But Ms. Spanberger said she has had conversations with colleagues in more solid blue districts about the impact of both hard-line liberal policy and the tone of opposition, which have prompted her to emphasize in town halls, sometimes unprompted, that she is “absolutely not a socialist.”

“When people say things in snarky ways or disrespectful ways or flippant ways, that creates an issue in districts like ours,” she said. “It’s real easy to be kind of snarky in the majority.”

At a pair of town halls last week in the deeply Republican suburbs of Salt Lake City, Mr. McAdams, an affable and mild-mannered former Salt Lake County mayor, fielded pointed questions about whether he supports the Green New Deal and socialism. More broadly, constituents worried how their moderate congressman might fare in the same caucus as the liberal bomb throwers. Richard Hansen, a Republican county commissioner and one of the two dozen constituents who attended the town hall in Nephi, a mountain town of 6,000, shared a wish with the Utah Democrat: “I hope they don’t corrupt you.”