About 20 miles East of Yale on the I-95 lies a cluster of towns that, while geographically proximate to the county’s urban core, look and feel worlds away from New Haven.

In the communities that abut the shoreline — Madison, Branford and Guilford — beach properties abound. The towns that sit inland feature acres of farmland and marshes, miles of hiking trails and flocks of hawks and falcons. Historic homes line Route 1, the main thoroughfare running through these towns.

Even the homes that do not boast historical landmark status are large and remote from their neighbors, dotting backwoods roads and cul-de-sacs. Notables ranging from Jim Calhoun, the retired head coach of the University of Connecticut’s powerhouse men’s basketball team, to Jill Abramson, the former executive editor of the New York Times, have vacation homes here.

The quiet charm of these shoreline communities belies the fervor with which two Yalies, both Democrats, are mounting first-time bids for elected office in overlapping districts here.

Ted Kennedy Jr. FES ’91, a health care lawyer and scion of the most famous political family in U.S. history, is running for Connecticut state senate in the 12th District, which includes Madison, Branford, North Branford, Guilford, Durham and Killingworth.

Kennedy faces Republican businessman Bruce Wilson Jr. in the race to replace Edward Meyer ’57 LAW ’61, who is resigning his seat after a decade on the job.

Even with Meyer’s resignation, Yale Law School may not lose representation on the shoreline. Not if Alex Taubes LAW ’15 — a 25-year-old, champion collegiate debater and Democrat — can wrest the 101st House District from incumbent state rep. Noreen Kokoruda, 67.

A Republican, Kokoruda has represented the district, which includes Madison and part of Durham, since 2011. Before that, she served 14 years on Madison’s Board of Selectmen.

Gary Rose, who chairs the department of government and politics at Sacred Heart University in Connecticut, said a Democratic victory in these towns would solidify a broader shift in partisan politics in the state. Conventional wisdom holds that Connecticut is sharply divided between urban blue — New Haven, Bridgeport and Hartford — and suburban red — Darien, Greenwich and New Canaan. That view overlooks creeping progressivism, Rose said, pointing in particular to swing towns that line the shoreline on the outskirts of New Haven.

For the most part, these are wealthy communities. Madison’s median family income is $125,199, the 22nd most prosperous in the state. Yet there are residents who feel the weight of unemployment; these towns are not impervious to economic trends that have sacked cities like New Haven and Hartford.

“The recession officially ended five years ago,” Kennedy said, but for the average person, it does not feel that way.

Because that sentiment prevails among voters, the candidates are in the precarious position of trying to motivate their base while distancing themselves from the Democrat at the top of the ticket.

On a late August weekend, in a two-room-warehouse-turned-Democratic-headquarters in Madison, Jean Fischer, who was nearing her 84th birthday at the time, was picking up call sheets to make calls for Taubes. On the sheets — prepared in VoteBuilder, an online voter database system marketed as “the indispensible tool for winning elections” — one column was struck through in red Sharpie: the instruction to ask voters about Governor Dannel Malloy.

“He’s going to do badly here,” Taubes said of the governor, who is up for reelection against Tom Foley, a Greenwich businessman and Republican. “We don’t ask people about Malloy.”

Two weekends later, Kennedy offered a similar appraisal, though his words were less blunt: “I think it’s going to be a close race.”

Instead of state party affiliation, then, these two candidates are emphasizing their local roots. Taubes was raised in Madison, and Kennedy, who turns 53 on Friday, has lived in the area for about 30 years. Twenty of them were spent in Branford, his current home.

They are also glued to the campaign trail, insisting on face-to-face interactions with voters. Kennedy said he learned this brand of politics from his father, the late U.S. Sen. Ted Kennedy.

With a young staff schooled in the Obama-style ground game, Taubes thinks he will win by outworking his opponent. At the Connecticut Democratic State Convention in May, U.S. Senator Chris Murphy took Taubes aside for a lesson in local politics, the young candidate recalled.

“You’re running for state rep … you’re the same age I was when I first ran,” Taubes recalled the first-term senator from Connecticut telling him. “I have one piece of advice: knock on doors.”

At each door, Taubes and Kennedy are telling personal stories that, while otherwise considerably different, both feature chapters at Yale and in New Haven.

For Taubes, attending law school at Yale meant the chance to do clinic work in New Haven. The summer after his first year, he worked on economic development in the city, an experience he said shaped his understanding of inequality and economic stagnation. He would later offer then-mayoral candidate Toni Harp advice before debates. Last fall’s election, he said, informed his decision to return to his parents’ house at the beginning of the year and run for office in his hometown. Harp, unlike her opponent, was “of New Haven,” he said. He wanted similarly deep ties to the community he would be asking to elect him.

Kennedy’s schooling, political and otherwise, spans Connecticut and Massachusetts, the latter state’s political history all but synonymous with his last name. He broke with his family’s predilection for Harvard and went to college at Wesleyan instead. He would return to Connecticut several years later for master’s work in New Haven at the Yale School of Forestry and Environmental Studies.

Abjuring politics for years, Kennedy is now entering the family business — but in Connecticut and on a more local scale than has been Kennedy tradition.

Still, there is fanfare. At the candidate’s announcement this spring, at a local public library in Branford, guests held signs that read, “Finally!”

There was scarcely a stop on Kennedy’s Saturday tour of Branford, Madison and Guilford in which he went unrecognized. Some greeted him as they would a celebrity, saying they had seen his picture in the paper when he was a kid. Others began rattling off demands, presuming his victory.

“Forgive me for recognizing you — you’re not exactly incognito,” Beverly Keener, a vendor at the Dudley Farm in Guilford, told the candidate.

This excitement will cause Democratic voters to turn out in droves, Taubes predicted. Even if voters have lost faith in the governor, he said, their support for shoreline Democrats reveals a deeper optimism about Connecticut’s future — a trust that economic conditions will improve with continued investment.

Fischer, who has nearly 60 years on the candidate for whom she was making calls, put it more simply. The race is about whether these towns will become more like Greenwich and the rest of Fairfield County, or whether they will remain accessible to mixed-income people, perhaps even those coming from the county’s urban core, New Haven.

“He’s up against real hard stuff,” she said, assessing Taubes’ chances.

She had little patience for being interviewed, turning instead to her candidate, coaching him on his message, on vote-pulling and on self-promotion. Stand in front of the table to shake voters’ hands, she told him.

Leaning forward, Taubes rested his clasped hands on his knees and listened.