O’Brien joined Barnsley from Scottish side Motherwell two years ago.
“Jim O’Brien has agreed to sign an extension to his deal. But for injury last season he would have been outstanding,” Barnsley manager Keith Hill told the club’s official website.
“I’m really excited about the prospect of working with Jim for at least another two seasons.”