PHOENIX – Coach Kyle Shanahan walked into a position with the 49ers in which he had no quarterbacks on the roster.

On the first two days of free agency, the 49ers added Brian Hoyer and Matt Barkley. He determined they were better fits for the offense he would be installing over Colin Kaepernick, who started 64 regular-season and postseason games for the 49ers over the past 4 ½ seasons.

Shanahan appeared to be looking for quarterbacks who are more proficient at going through progressions and making plays from the pocket. Kaepernick was not deemed as a good fit for Shanahan's offense.

“Colin’s had a great career, and he’s done some really good things,” Shanahan said on Wednesday at the NFL owners meetings. “I think Colin has a certain skillset that you can put a specific offense to it that he can be very successful in.

“When we first looked at it, you got to look at each quarterback and what type of offense you want to put in. That wasn’t necessarily the direction I wanted to go. I wanted to put in a different type of offense.”

Kaepernick opted out of his contract to become an unrestricted free agent. General manager John Lynch has confirmed the 49ers would have released Kaepernick if he had not opted out of his deal.

“The type of offense I wanted to run was somewhat different and that’s why we went that type of direction,” Shanahan said.

The 49ers’ top target in free agency was Hoyer, who enters his ninth NFL season with his sixth different team. Shanahan was offensive coordinator with the Cleveland Browns in 2014 in Hoyer’s second and final season with the club.

Hoyer started five games with Chicago in 2016 before getting sidelined with broken left arm. Hoyer completed 67 percent of his passes with six touchdowns and no interceptions in 200 attempts.

“All these questions about what I like in a quarterback, Brian is like that,” Shanahan said. “He’s obsessed with the game. He will learn your offense. He’ll be able to execute and run it. That gives other guys a chance to perform in your offense. If your quarterback can’t execute it and go through it, it doesn’t always matter what the O-line or the receivers are doing.

“With Brian, you have a very smart guy who works at it, will hang in the pocket and is fearless, will keep his eyes down the field and deliver the ball to the right spots. It gives people a chance to be successful.”

The 49ers also reached a contract agreement with Barkley, who started six games with the Bears due to injuries to Jay Cutler and Hoyer. Barkley saw the most extensive playing time of his career. He completed 59.7 percent of his passes with eight touchdowns and 14 interceptions.

“Just watching Matt since college, Matt’s always been a solid player, even coming out and playing at an early age at (USC),” Shanahan said. “He’s battle-tested in that way. He’s gone through the pressure of college, the pressure of the draft, being in the NFL, being with some different teams. Even watching Matt in Chicago this year, I think he played better this year than he has throughout his career. That means the guy is continuing to work at it.”

The 49ers figure to go to training camp with four quarterbacks, so the team is not finished at the quarterback position.

“We’ll look to add anyone who can really help us,” Shanahan said. “I’m very happy with the two we got. You know we’re not only going to take two to camp. So we got to see how the draft works out and then you see what else is out there.”