Last October, Hillary Clinton and her top aides were debating one of those seemingly trivial yet politically consequential decisions that often bedevil a Me Generation candidate in the YouTube era.

Should Clinton, at times cautious to the point of rigidity, sing a boozy ballad with her Saturday Night Live impersonator Kate McKinnon at the end of her turn as “Val the Bartender?”

Story Continued Below

The internal debate ebbed back and forth -- the candidate herself was ambivalent and some aides thought it would make her look silly. Quietly, they reached out to Philippe Reines, a former Senate and State Department aide who hadn’t been invited to work on the 2016 campaign, yet had always helped to manage her big-stage moments in the past.

Reines urged her to do it. He flew with Clinton in a private jet to New York, negotiated some details of her appearance with the writers at NBC, and stood backstage while she was warbling “Lean on Me” to provide moral support, according to two people familiar with the situation.

The selection of the colorful, combative, cloak-and-dagger, defiantly wise-ass Reines as Donald Trump’s stand-in during debate prep sessions, first reported by the New York Times on Saturday, came as a surprise to many outsiders. The idea: Clinton’s in-house Trump to be someone with no vested interest in pulling a punch -- like SNL alum Al Franken, the Minnesota senator; or financier Robert Wolf, who lobbied for the gig.

But it was no shock to the people who know the candidate or the 46-year-old Reines, who lives a bachelor’s life in Washington with two doted-upon cats named after Saddam Hussein’s sons, Uday and Qusay. Clinton, facing what could be the biggest night of her political life on Monday when she squares off against Trump in the first presidential debate of 2016, made an intuitive, even predictable choice, turning to a member of the tiny inner circle she has often relied on in times of maximum stress.

The fact that she would tap a trusted defender to portray her most savage enemy says a lot about Clinton’s management style, and her circle-the-wagons psyche even during times when other politicians might reach outside for help. There’s staff, and then there’s the palace guard – and Reines, despite an up-and-down career with Clinton, is practically Jaime Lannister.

“The debate prep team is made up of people who are really comfortable with her and she's comfortable with them,” said Clinton’s 2008 campaign manager Patti Solis Doyle, who began her career as young member of Clinton’s Hillaryland posse in the East Wing in the 1990s.

“Everybody’s always saying Hillary needs to project her authentic self, but Philippe is one of the only ones who knows what that is, and knows how to get her to go along with that,” said a person who knows both. “He’s the one who urges her to abandon the caution, to go for it. And she’ll listen to him, and that’s because she trusts him.”

Clinton’s relaxed SNL appearance, self-deprecating but dignified spot, shows why. She flubbed the song but laughed her way through it – and It worked. That hasn’t always been the case for a 68-year-old pop culture staple who struggles to understand pop culture: Many on her staff still regret letting the boss do a deeply awkward version of the "nae nae" dance on the Ellen Show.

Clinton also trusts Reines precisely because he shares her skepticism – bordering on hostility – toward most of the D.C. and national political press to whom he routinely refers as “idiots” or worse in private conversation. He’s famous for his flame-out emails to reporters over the years -- calling former POLITICO blogger and current BuzzFeed editor-in-chief Ben Smith a moron in a 2008 email, telling the late BuzzFeed correspondent Michael Hastings to f—k off in another, and challenging yours truly in 2009 to take a lie-detector test after it was suggested Reines was scheming to force Caroline Kennedy out of contention for Clinton’s vacated Senate seat in New York.

Clinton aides expressed astonishment that the fake Trump’s identity hadn’t been ferreted out sooner – Reines has, according to one person with direct knowledge of his involvement, participated in as many as a half-dozen mock debates and more relaxed moot-court sessions, peppering the candidate with lines cribbed from Trump’s primary debates and personal attacks meant to keep the candidate off balance. “Nothing is really off-limits,” the person told POLITICO. “In some ways it’s easier for him to say these nasty things to her because she knows he has her best interests at heart.”

His brushes with the media – and his flamethrower reputation with fellow staffers – left him largely on the sidelines in 2008 until he emerged, late in the primaries, as a travelling adviser and PR bodyguard for Chelsea Clinton – and, consequentially, as a late add to her debate-prep team. Reines’ relationship with Hillary Clinton is personally close, but has been professionally rocky from time to time; she has long told people she likes him “because he makes me laugh,” but has lectured him for picking public fights and nearly sacked him when he worked for her in the Senate for a variety of over-the-top transgressions, according to former Clinton staffers.

Controversy followed him to Foggy Bottom, where he waged endless turf battles and was rapped over the knuckles in an inspector general’s report. And Clinton was none too happy when Reines, who has a weakness for too-clever-by-half schemes, handed her a Staples “Reset” button to deliver to dour Russian Foreign Minister Sergei Lavrov – only to be told the Cyrillic inscription was wrong.

But Reines endeared himself in other ways, and exhibited skills that serve him in his role as debate stand-in. In 2007, Reines – then a member of Clinton’s Senate staff – oversaw an effort to discredit and defuse a pair of potentially damaging biographies of his boss. He obtained bootlegged pre-publication printouts of the tomes from various sources and distributed the contents to a team of researchers who scoured the texts for errors, inconsistencies and off-key passages he later trotted out in Clinton’s defense.

“Is it possible to quote me yawning?” Reines said when asked to summarize the contents of an investigative biography penned by two New York Times scribes.

She loved that one, and has rewarded him with loyalty, even when other called for his scalp. When Clinton accepted Barack Obama’s invitation to run the State Department in late 2008, Obama’s deputy chief of staff Jim Messina tried to block his appointment as a strategic adviser assigned to Clinton’s personal staff – and the new secretary overruled the decision and installed Reines as a central member of a management team that included longtime Clinton confidante Cheryl Mills, aide-de-camp Huma Abedin and Jake Sullivan, who is now her campaign policy chief.

Prior to the Democratic convention in late July, Reines, who works at a consulting firm that specializes in defense and foreign policy, had been speaking with Clinton from time to time on messaging and press issues, but “not in a regular, systematic way,” according to one Clinton insider. Around the time of Clinton’s SNL appearance, Reines accompanied Clinton on a flight to a town hall in New Hampshire moderated by Reines’ friend, “Today” show co-host Savannah Guthrie – but he kept a low profile after that.

Then, after the Democratic National Convention, Clinton’s staff began informally kicking around names for people to play Trump – a list that included Franken, along with entrepreneur and reality show host Mark Cuban. The sticking point with all of those people, sources told POLITICO, was the candidate’s comfort level. It’s not clear who came up with the idea of tapping him but Sullivan, Abedin and Karen Dunn, one of the lawyers overseeing debate prep sessions (and a Reines friend), backed the idea – and Clinton quickly approved.

There was another consideration: Reines had a day job, but controlled his own hours, and the Trump role, above all, requires “someone who has lots and lots of free time,” according to one Brooklyn aide.

It also required days of cramming, along with hours of YouTube-watching to replicate Trump’s distinctive speech patterns and habitual lines of attack.

Yet there was one skill Reines didn’t have to study up on: New York attitude.

“I was a good Bush for Gore because I am stupid but cocky,” said Paul Begala, a central player in Al Gore’s ill-fated 2000 debate prep effort. “Philippe is a good Trump for Hillary because he is clever but obnoxious.”

Annie Karni and Rebecca Morin contributed.