The 39-year-old was Molby's assistant at Kidderminster, and resigned shortly after the Dane did.
He will join Molby in the same position at Boothferry Park when pre-season training begins with light fitness work next month.
City chairman Adam Pearson confirmed Barnett's appointment: "We've reached an agreement with Kidderminster which covers Jan and Gary and I can confirm he will be joining us as assistant manager.
"I'm not prepared to discuss details of the agreement. It is sensible and I'm grateful to Kidderminster for the way they have approached the negotiations.
"It is very amicable. Both sides are happy. It has cost me money but that's all I'm going to say."