"It's great to retain such a big piece to our bullpen puzzle," Sabean said.
He has spent the past four of his 11 major league seasons with San Francisco, going 10-9 with a 2.73 ERA in 237 1-3 innings and 184 outings.
Affeldt dealt with two bizarre, non-baseball injuries the past two seasons.
In late April, he sprained his right knee and went on the disabled list after he reached out to catch his son, Walker, as the 60-pound 4-year-old jumped off the couch to hug his arriving father.
On Sept. 8, 2011, the pitcher sliced his non-throwing hand nearly to the artery while separating frozen hamburgers during an outdoor barbecue with his family on an off-day. The paring knife he was using pushed through a hamburger patty and deep into his hand. Affeldt came within a millimeter of an artery and underwent surgery about eight hours after the injury to repair nerve damage in his pinkie.
"Those are fluke injuries," Bochy said. "These guys have to live their lives. We let these guys live their normal lives — that's the way it should be. We're all occasionally going to have them, and he has a knack for the good ones."