Anyone who has seen the documentary Weiner may not have been entirely surprised that it was former congressman Anthony Weiner who threw a late spanner in the works of Hillary Clinton’s campaign. The film charts in excruciating detail the collapse of a political career and, ultimately, of a marriage.

Weiner’s laptop is now reportedly under scrutiny by the FBI lest it contain emails pertinent to Clinton’s private server. But if there is a movie sequel to be made, it might be called Podesta. An avalanche of tens of thousands of other messages, hacked from Clinton campaign chairman John Podesta’s gmail account and released by WikiLeaks in regular bursts over the past month, has provided an unprecedented window on the inner workings of a presidential run.

There, laid bare with all the brutal candour of a fly-on-the-wall documentary, are the office politics, the egos, the cliques, the evolving attempts to package a candidate who admits she is not a natural political performer like her husband or Barack Obama. The hoard offers insights that would not normally see the light of day until memoirs published years or decades hence.

The Clinton campaign has blamed the Russian government for breaking into Podesta’s account and passing on the material to WikiLeaks in an attempt to help Donald Trump win next week’s election. It has generally declined to confirm or deny the authenticity of the emails, but Podesta, a veteran of nearly half a century of US politics, says he has spoken to the FBI “as a victim” of hacking.

Clinton’s handling of classified information as secretary of state – which flared up again last week thanks to Weiner – has cast a shadow over her entire campaign and been a source of much angst at her headquarters. When the issue first reached public attention in March last year, Podesta wrote of three fellow Clinton aides: “Speaking of transparency, our friends [David] Kendall, Cheryl [Mills] and Philippe [Reines] sure weren’t forthcoming on the facts here.”

The message was sent to Neera Tanden, president of the Center for American Progress thinktank in Washington, who has a regular cameo in the emails. She wrote back: “This is a Cheryl special. Know you love her, but this stuff is like her Achilles heal [sic]. Or kryptonite … Why didn’t they get this stuff out like 18 months ago? So crazy.”

Podesta replied: “Unbelievable.”

Tanden added: “I guess I know the answer. They wanted to get away with it.”

Both Tanden and Podesta are unswervingly loyal to Clinton, but could be described as critical friends. In another exchange in September 2015, Podesta warned that the campaign has “taken on a lot of water that won’t be easy to pump out of the boat. Most of that has to do with terrible decisions made pre-campaign, but a lot has to do with her instincts. She’s nervous so prepping more and performing better. Got to do something to pump up excitement but not certain how to do that.”

Tanden assented: “Almost no one knows better [than] me that her instincts can be terrible.”

When the seemingly innocuous leftwing senator Bernie Sanders came out of nowhere to challenge Clinton in the Democratic primary, there were fears of a repeat of her shock defeat by Obama in 2008. Tanden warned Podesta against attacking Sanders too aggressively.

“Just game out what that does to Hillary,” she wrote in August last year. “When we went after Obama, she got killed for it. Reaffirmed all her negatives, strengthened him. We had no idea it was kryptonite for us to do that, but it was. I don’t know if it was Obama or Hillary (I suspected Hillary), but it’s really something to focus group beforehand.”

In December, when Tanden wrote in praise of the Paris climate deal, Podesta responded: “Can you believe that doofus Bernie attacked it?”

Then, in March this year, Clinton strategist Minyon Moore opined: “I think Sanders is a rule breaker and has no institutional loyalty to the Democratic Party; we should expect him to ignore the rules and persist in his quest to flip superdelegates despite overwhelming evidence that reflects his considerable weaknesses with the Democratic base and no doubt in the general.”

Tanden, meanwhile, pulled no punches when Clinton’s campaign hesitated over whether to condemn Democratic activist David Brock for demanding Sanders’ medical records. She wrote: “Hillary. God. Her instincts are suboptimal.”

A stout defender of Clinton in public, in private Tanden injects some bracing honesty that suggests the candidate is not surrounded by sycophants. After the former first lady described herself as a moderate, Tanden asked of Podesta: “Why did she call herself a moderate?”

He wrote back: “I pushed her on this on Sunday night. She claims she didn’t remember saying it. Not sure I believe her.”

Tanden replied: “I mean it makes my life more difficult after telling every reporter I know she’s actually progressive but that is really the smallest of issues. It worries me more that she doesn’t seem to know what planet we are all living in at the moment.”

The daily dump of stolen emails has uncovered Clinton’s lucrative Wall Street speeches, lists of 39 potential vice-presidents and 84 potential campaign slogans, fresh questions over a conflict of interest with the Clinton Foundation and alleged advance warnings of debate questions. But there have been few revelations likely to alter the course of the race for the White House.

In fact, just as WikiLeaks’ release of US embassy cables often showed diplomats’ judgment in a flattering light, so the Podesta emails have illuminated a micromanaged campaign operation with a laser-like focus and little by way of ill-discipline or even foul language. The nerve centre is, however, all too aware of its candidate’s weaknesses and sensitive to media criticism, and as prone as any other office to personality clashes, terse exchanges and mutual exasperation.

The email treasure trove also lifts the lid on the complications of celebrity endorsements. In August 2015, Betsy Jones, assistant to the hip-hop star Q-Tip, wrote to Podesta to propose a meeting with Clinton “to discuss ways he can be used as bridge to the hip-hop generation during the 2016 presidential campaign”. Q-Tip “even served as DJ for Chelsea Clinton’s 25th birthday party in 2005”, she noted.

Podesta forwarded the email to colleagues, one of whom was Weiner’s wife Huma Abedin. “Q-Tip? Seriously?” she wrote. “I am so old.”

Another, Kristina Schake, weighed in: “I’ve actually seen Q-tip in concert and if this meeting happens I would like to staff her.” She elaborated: “With both the Beastie Boys and the Chemical Brothers!”

But then the conversation took a darker turn when another member of Clinton staff, presumably responsible for background checks, raised concerns over Q-Tip: “There are a couple of altercations he pleaded guilty to, but they were from a while back. However, more recently shouted ‘pigs’ at NYPD officers while protesting the grand jury decision not to indict Darren Wilson.”

It took a while, but the meeting did go ahead.

Then there are campaign surrogates who go rogue. Lanny Davis, a lawyer and former special counsel to Bill Clinton during his presidency, put his foot in it when talking about Clinton’s email server on TV. Later that day Robby Mook, now the campaign manager, emailed Podesta: “We gotta zap Lanny out of our universe. Can’t believe he committed her to a private review of her hard drive on TV.”

In May last year, Podesta wrote of longtime Clinton family friend Sidney Blumenthal: “It always amazes me that people like Sid either completely lack self awareness or self respect. Maybe both. Will you promise to shoot me if I ever end up like that?”

Podesta, 67, runs a tight ship and has an unenviable job. Countless people want to give him advice or meet him for dinner. In September last year, columnist Brent Budowsky wrote a long, panicked email about visiting a university campus where Sanders had a booth but Clinton did not. “This is happening at every major campus in America,” he warned darkly.

Referring to a Politico story about attacks on Sanders by Clinton surrogates, Budowsky went on: “The way NOT to handle Bernie is to telegraph how afraid the Clinton campaign is of him, and then dispense covert talking points that cannot be put in writing that embody the oldest politics that will only infuriate many liberal Democrats and give an already-biased media a legitimate story line to push.”

Podesta gave a characterically brisk response that ended: “Why do you think that story is not just a bunch of hyped up BS intended to have exactly the kind of reaction you are exhibiting?”