General manager Doug Wilson announced the move Thursday, saying Hannan will be a good mentor for younger players. The Sharks also signed forwards Michael Haley and Bryan Lerg to one-year deals.
The 35-year-old Hannan played 56 games last season with three goals and nine assists. Defenseman Matt Tennyson, a restricted free agent, signed a two-year contract.
Hannan might not get as much playing time next season as the Sharks want to give a bigger opportunity to younger players like Tennyson, Mirco Mueller and Taylor Doherty.
Haley has two goals and one assist in 53 career games with the New York Islanders and New York Rangers. He spent last season in the AHL.
Lerg has played 280 career games in the American Hockey League.