At the end of a sensational season in which Aaron Judge was the AL Rookie of the Year, runner up in the AL MVP race, an All-Star, Home Run Derby champ and a big part of the Yankees being nine innings away from the World Series he huddled with the club’s medical staff.

“The shoulder had bothered him throughout the year and he had an MRI and they found a loose body in there. Dr. Chris Ahmad told him that it wasn’t something they would move on now or recommend doing anything with,’’ general manager Brian Cashman said Tuesday, a day after the right fielder underwent arthroscopic surgery on his left (non-throwing) shoulder in Los Angeles.

“[Ahmad] said we can take it out if [Judge] wanted but said, ‘Why don’t you see how it plays out in the next few weeks. If you still have discomfort we can do a quick in and out and get it out of there, remove the loose body and clean it up.’ ”

When Judge checked back with Ahmad and said his shoulder was still bothering him, the right fielder said he was going to see Dr. Neil ElAttrache in Los Angeles. ElAttrache said the same thing Ahmad had and it was ElAttrache who performed the surgery, removing the loose body and cleaning up some damaged cartilage.

The Yankees are confident Judge, who led the AL with 52 homers, 128 runs scored and 208 strikeouts to go with 114 RBIs and a 1.049 OPS will be ready for spring training.

“No one has led me to believe it’s an issue. I can only respond to what the medical people say,’’ Cashman said.

Asked if Judge received cortisone injections during the season, Cashman said, “I wouldn’t say.’’

Since Judge made a catching tumbling over a Fenway Park wall on April 26th, his 25th birthday, Cashman was asked if that is when the discomfort first surfaced. As he said all season, Judge said he felt fine after the game.

“You saw him icing his shoulder a lot, so it was clearly something that he felt,’’ Cashman said of Judge, who hit .326 with 27 homers and 62 RBIs in 76 games during the first three months of the season, .230 with seven homers and 13 RBIs in July and .185 with three homers and seven RBIs in August. He rebounded to hit .311 with 15 homers and 32 RBIs in the final month of the season, but hit .188 with four homers and 11 RBIs in the postseason.

While Cashman has faith in his medical staff Dr. Leesa Galatz, the systems chair of the department of orthopedics at Mount Sinai Health System, said cartilage getting into the joint could be a problem.

“The fact that he has some cartilage damage that is bad enough to generate some loose bodies is concerning,’’ said Galatz, who hasn’t examined Judge. “Depending on how bad it was he could come back to play but it is concerning at 25 to have. Sometimes having this done helps. It’s like hitting the reset button on the computer. You don’t have a perfect computer but you are removing things inside the joint that are causing pain and inflammation so you are getting that joint a fresh start.’’