Kyle Shanahan is the 49ers’ fourth head coach in four seasons. (Marcio Jose Sanchez/AP)

SANTA CLARA, Calif. — He is young and rich, the occupant of this spacious office with the “Head Coach” placard out front, a man in control of one of the most prestigious franchises in sports: the San Francisco 49ers.

And yet, he still thinks about it.

“Washington changed me,” Kyle Shanahan says in the corner of that big office. Then: “I’ve just never been attacked like that before.”

It’s been seven years since Shanahan, now 37, left a successful job with the Houston Texans to join the staff of his father, Mike Shanahan, as the Washington Redskins’ offensive coordinator; five since quarterback Robert Griffin III, the star of Kyle Shanahan’s relentless attack, pushed Washington into the playoffs and threatened to change the NFL; nearly four since “The Shanahans” — a label Kyle hated then and can barely stand now — lost a turf war with Griffin and owner Daniel Snyder before being fired in late 2013.

And what of the things that came next: One season in Cleveland, Kyle designing a scheme for Johnny Manziel before marching into his boss’s office to quit; next joining Atlanta and going to war with veteran wide receiver Roddy White one season before pushing quarterback Matt Ryan to the MVP the next. Then in February, as the Falcons’ 28-3 lead in the Super Bowl dissolved, Shanahan ordered a pass play late in the fourth quarter that led to a sack; Atlanta wound up losing to New England, of course, and even now Shanahan regrets his decision so much he won’t say the play-call out loud. He does this sometimes, when things bother him; when he can’t let go.

“I can live with the Super Bowl,” says Shanahan, who doesn’t do anything quietly, does he? Then: “It would’ve bothered me more if that had happened in Washington.”

Redskins quarterback Robert Griffin III (10) had a strong rookie season under Shanahan, the team’s offensive coordinator, but things didn’t go well during a 3-13 campaign in 2013. (John McDonnell/The Washington Post)

All this time later, with the setbacks and accomplishments in between, Shanahan still isn’t over the most important four years of his life. The worst and best four years, he believes — best because if not for that time he likely wouldn’t be sitting here and almost certainly wouldn’t be psychologically tough enough to lead a franchise.

“I’m better because of it, after going through what I went through,” he says. “. . . In Washington, the first time an article came out that you didn’t want Donovan (McNabb, the veteran quarterback for whom Washington traded in 2010, at Snyder’s insistence), it’s just — everyone’s going at you.

“All you want to do is get a microphone and defend yourself, and you realize you can’t do that. So you just sit there and internalize it, and it upsets you because you want to tell the truth.”

And, though not often into a microphone, telling brutal truths is often what he did. Kyle Shanahan was occasionally mouthy to superiors, putting things in blunt terms he’d later regret, and occasionally had to be calmed during meetings by his father. The young coordinator was talented and creative, but in his early 30s he was becoming known around the league as much for his impatience and short fuse. He struggled with office politics and with biting his tongue, a skill he’d improve upon later.

“I was very proud of what we did there,” Shanahan says now, “especially under some circumstances that weren’t the easiest.”

Such as?

He smiles. “Stuff that I think everyone can figure out on their own.”

Kyle Shanahan served as the Redskins’ offensive coordinator under his father, head coach Mike Shanahan. (Jonathan Newton/The Washington Post)

Still, some unwanted impressions attached themselves to him. Much later, when former NFL player and broadcaster John Lynch was being considered earlier this year to be San Francisco’s general manager, Lynch says, friends called to warn him about Shanahan.

“There are perceptions about him,” Lynch, the smiling counterweight to Shanahan’s intensity, says now. “He’s got his own thoughts on things, and they’re unique and they may not fit with the rest of the league. And I think at times people see that as aloof.”

Shanahan’s personality, methods and patience will be on full display this season, not just because he is a first-time head coach but because he is the 49ers’ fourth coach in four seasons. Jim Tomsula and Chip Kelly were there for one year each and a combined 25 losses, and Jim Harbaugh’s .695 winning percentage and Super Bowl appearance are a distant memory with a current roster that looks nowhere near playoff-ready.

San Francisco has no apparent franchise quarterback, and while Shanahan and Lynch received high marks on their first draft class, both expect it’ll take time — the coach and GM each signed six-year contracts — and plenty of patience to turn around the franchise.

By the end of 2012, Shanahan’s best and worst parts were becoming illuminated in the glow of Griffin’s superstar rookie year. The young coordinator was the subject of radio segments and newspaper profiles, attention that raised his cachet but occasionally made him uncomfortable. When television broadcasters asked for him to attend the pregame production meeting, Shanahan often refused — but would later phone the game analyst and spend hours discussing matchups and game plans. Shanahan, at 32, was the intemperate boy wonder at the wheel of a historic season, that year perhaps becoming the NFL’s most famous coordinator and an intriguing figure on the head-coaching track.

Shanahan helped lead Falcons QB Matt Ryan to an MVP season in 2016. (Curtis Compton/Associated Press)

Shanahan’s stint working with Browns quarterback Johnny Manziel resulted in Shanahan quitting his role as offensive coordinator after one season. (Aaron Josefczyk/Associated Press)

Then Griffin injured his knee in Washington’s playoff game following the 2012 season, and afterward rifts formed and sides were taken. The Shanahans, as it were, would be blamed in some circles for Griffin’s injury. Kyle Shanahan indicates now that the staff tried to protect Griffin but that the quarterback refused to follow their advice.

The next season, with Griffin on friendly terms with Snyder, the second-year player clashed with his coaches. Kyle Shanahan worried for his father and the way his career was ending; he knew, the younger Shanahan says, that “once that was done, he was done.”

News of backbiting and an organization torn apart seemed to leak each Sunday morning to national news outlets. By late December, with Washington working on a 3-13 season, Griffin deactivated and Redskins Park divided, it had become clear Mike Shanahan — and much of his staff — would be fired.

“You tried so hard to find a way that you could help the quarterback,” Kyle Shanahan says, “that you could help him make a play, that you could help him not get hit, that you could help teach him how to slide, that you could help do everything.”

The quarterback, he keeps saying. Which quarterback?

Shanahan smiles again. “I don’t know. All of them.”

He is doing it again, like the Super Bowl play-call. He won’t say Griffin’s name.

When this is pointed out to him, he relents. Shanahan is trying, he insists, to move on from the experience in Washington.

“We accomplished some great things with Robert,” he says. “I don’t mind saying his name.”

Shanahan continues.

“We felt like we did as good as we could to give him a chance to be successful. And the hard thing about that, that I don’t fully blame Robert for, is that the way we felt gave him a chance to be successful, the organization didn’t back. And they allowed Robert to choose what he wanted to do. Do you blame a 23-year-old for that, or do you blame the people that allowed him?”

Coach Kyle Shanahan and GM John Lynch both signed six-year contracts with the 49ers this offseason. (Marcio Jose Sanchez/Associated Press)

Because of his time in Washington, Shanahan says, he learned to recognize a toxic situation — and to withdraw from it. After one season in Cleveland, he approached Coach Mike Pettine — who, at the time, was the Browns’ fourth head coach in five years — and quit.

Shanahan learned, he says, that his honesty is valued by more players than it offends, and that, though this remains difficult for him, he occasionally must compromise.

“He’s going to tell you what he thinks,” Lynch says. “I’ll take that sometimes, and then I’ll take a deep breath and say: ‘Okay, well what would you think if we . . . ?’ He’s willing to listen.”

It taught Shanahan, he says, confidence to follow his instincts and, hard as this might be to believe, be patient. That’s something both he and San Francisco will likely need during the upcoming season and what is expected to be a long rebuilding period.

“I’m better because of what I went through in Washington,” Shanahan says, looking around this big office.

“It made it to where I can handle it.”