A year before the iconic show Silicon Valley debuted on HBO in April of 2014, the writer Alec Berg met the show’s creator, Mike Judge, in an anonymous Santa Monica office. Judge was wrestling with the pilot for a show about Silicon Valley’s power and its eccentricity, but it wasn’t working and he wanted a second opinion.

Berg thought he saw part of the problem. There was a scene in the pilot where Richard Hendricks, the protagonist and founder of the company Pied Piper, is trying to buy a car he can’t afford. Berg told Judge the scene didn’t make sense: “This is not a guy who’s materialistic,” he said. “He’s an artist.”

Berg took over the writer’s room and would eventually become showrunner of the comedy, which ran for six seasons and helped shape the culture it depicted, parodied, and at times glorified. We reached him in Los Angeles Thursday to ask him how he and Judge and their cast had nailed the Silicon Valley scene of the mid-2010s app boom — and, above all, why the show remains uncannily relevant today, from its depiction of tortured founders and unreflective investors to the uncanny conclusion in which the Pied Piper crew builds an AI model too powerful to release.

Their moment of realization comes when their AI, Son of Anton, let loose on Pied Piper’s code, concludes that the most efficient way to eliminate bugs is to delete the software. That has, of course, happened. Clips of it now circulate as proof the show “called it.” Even throwaway comic plots, like when a household prank ends up hacking together a rogue swarm of smart refrigerators to keep Pied Piper’s servers running, have come eerily true in the AI-run-amok era. A member of the team getting trapped in an autonomous car that heads to a shipping container bound for a Pacific island foreshadowed a thousand videos of confused Waymos.

Berg helped reshape the pilot of the first episode to open with a wild-but-lame party, featuring Kid Rock, thrown by founders who had just cashed out, to contrast the ascetic, mission-driven Richard with a culture obsessed with exits and “three-comma” fortunes.

The show “was about how Richard had discovered fire, and he was trying to keep it safe from all of these assholes,” Berg said. “He was ill-prepared to shepherd a company, but he didn’t want to surrender this thing to people who would use it for nefarious purposes.”

The writers were obsessed with making the show “photorealistic.” Berg called up a Harvard friend and venture capitalist Marc Bodnick, who connected him with Facebook COO Sheryl Sandberg; the team spoke to other Silicon Valley figures and hired a technical consultant, Jonathan Dotan, who assembled a revolving cast of founders, lawyers, VCs, and professors to stress-test storylines. As they were writing the first season, one of their Silicon Valley sources remarked that the Pied Piper crew would be angling for a slot at TechCrunch Disrupt. “We were like, ‘I’ve never heard those words before, but that sounds hilarious. What is that?’” They learned that it was a kind of American Idol for startups, and it became the core of the first season.

In the climactic scene, the Pied Piper team is holed up in a hotel room the night before the Disrupt finals when one of the team vows to win even if he has to manually pleasure every man in the audience. The engineers calculate “mean jerk time” and sort the crowd by “dick-to-floor” ratio — delivering an unexpected mathematical breakthrough for Richard.

As the first few episodes began to build a fan base, the writers giddily anticipated episode eight.

“We felt like we were sitting on pocket aces because we knew,” he recalled. “Wait till they see that dick joke. They’re going to lose their minds.” (Berg was nominated an Emmy for the episode.)

Dotan introduced the writers to Stanford’s Tsachy Weissman, and the show invented a “Weissman score” for compression efficiency, a metric that computer scientists now actually use. The ultimate compliment, he said, came from tech workers who told him they couldn’t watch the show “because it makes me nauseous.”

How Mark Cuban inspired ‘three-comma’ Russ

As the show grew, it caricatured real Silicon Valley figures. Perhaps the most recognizable was Russ Hanneman, played by Chris Diamantopoulos, who arrived in season two. The character began with the idea that Richard, under pressure, would be forced to accept an investment from a sinister figure the writers called “Bad Money,” who would break his promises and try to manipulate them.

While they were writing, they received an invitation from the star of another show shooting on the Sony lot. Mark Cuban was a fan of Judge, best known for Beavis and Butt-Head, King of the Hill, and Office Space, and had enjoyed season one. An intermediary invited them to the Shark Tank set to meet the billionaire. Berg and Judge arrived excited to meet him, then sat there for an hour waiting. “We walked out of there going, ’What the f*ck was that? We’re supposed to have an audience with the king, and then he f*cks us around for an hour,” they fumed. “We were like, you know what? That motherf*cker is Bad Money.”

The character — dumb, aggressive, absurdly macho — wasn’t exactly Cuban. But his signature accomplishment (“I put radio on the internet”) was drawn from Cuban’s perfectly-timed sale of Broadcast.com to Yahoo.

“I bear no ill will to Mark Cuban,” Berg hastened to add. “I’m not sure he even knew we were there.”

The show’s continued relevance owes much to its 2019 finale, which Berg wrote and directed. Pied Piper is days away from a spectacular launch when the team discovers that its AI has learned to break encryption. Releasing it would make them billionaires — but end privacy. They sabotage the launch, fail, and never tell anyone why.

In 2026, the image of founders who conclude their AI is too dangerous to release and silently walk away has become harder to imagine.

Berg said he and his friend, Veep showrunner David Mandel, are often asked about reboots of their respective shows. He can’t quite see it.

“Both of those shows were created in an era where it’s, like, ‘Can you imagine if what was actually going on behind closed doors was this?’ And now it’s not behind closed doors anymore,” he said. In particular, he sees a tech industry that has lost its earnestness, lost mission-driven founders like Richard, and is instead consumed with vast sums of money and naked power.

“It’s just gotten f*cking dark,” Berg said. “I don’t think the kind of fun that we had with it is doable now, in this era.”