Yusuf replaces West Indies paceman Jayden Seales, who was denied a No-Objection Certificate by his home board.
The 27-year-old Yusuf has featured in two Test matches and an ODI for the Proteas while he has taken 131 wickets in first-class cricket at an average of just over 28.
Yusuf came highly recommended by new Hampshire head coach Russell Domingo, who also mentors the seamer at South African domestic team, the Lions.
It will be Yusuf's second stint in English domestic cricket having played for Durham last year.
Hampshire's director of cricket, Giles White, said: "Naturally, it is disappointing not to have Jayden with us, but we are pleased to have secured an excellent replacement in Codi Yusuf.
"Codi, who plays for the Lions, comes highly recommended by Russell and brings valuable international experience, as well as familiarity with English conditions following his spell with Durham last season.
"The past couple of weeks have been frustrating as we have had to adjust our plans at short notice, but we are delighted to welcome Codi and look forward to his arrival."
Hampshire start their 2026 County Championship campaign on Friday when they host Essex in Southampton.