Mr. Sanders’s most notable partnership with a Republican was also one of his greatest successes. In 2014, Mr. Sanders, as chairman of the Senate Veterans Affairs Committee, worked out an accord with Senator John McCain, Republican of Arizona, on a bill to expand veterans’ access to health care after a scandal involving veterans’ hospitals across the country.

The bill did something Republicans wanted: It allowed veterans to go outside the official hospital system to get care under certain circumstances, while it expanded the government services that Mr. Sanders demanded.

“Given how liberal he is, it made the work hard,” Mr. McCain recalled last week. “But he was an honest liberal. I’ve worked with people who tell you they are going to do one thing and then do another, and Bernie did what he said. And he was very effective. ”

Big legislation largely eludes Mr. Sanders because his ideas are usually far to the left of the majority of the Senate — from his notions about bank regulations, to the increase he seeks to the minimum wage, to his attempts to get the federal government in the business of providing rebates for the purchase and installation of solar heating systems.

But from his days in the House, where he served from 1991 to 2007, and into his Senate career, Mr. Sanders has largely found ways to press his agenda through appending small provisions to the larger bills of others.

In the House, he attached a measure to prevent the George W. Bush administration from finalizing rules that would have allowed companies to cut the pensions of older workers. Community health care clinics were expanded via a Sanders amendment to President Obama’s health care law. His amendments with Mr. Grassley to prevent bailed-out banks from replacing American workers with foreign ones was part of a major economic stimulus bill in 2009.

“The reason he has been so successful is that he built very strong left-right coalitions, ” said Warren Gunnels, a longtime policy adviser who now works on Mr. Sanders’s campaign. “He doesn’t see himself as on the left. He sees himself exclusively as fighting for working people.”