The 26-year-old will join the Reds as a free agent on 1 July after turning down a new deal with the Scottish Premiership side.
"I'm really happy to be back. I was here a good few years ago and I enjoyed my time," he told the club website.
Barnsley finished fifth in the Championship last season but lost to Swansea in the play-offs.
USA international Daryl Dike, who scored nine goals in 19 league appearances in the second half of the campaign, has now returned to parent side Orlando City.
Boss Valerien Ismael said: "It is important that we continue to progress as a club and getting this deal done so quickly is a clear indication that we intend to be competitive next season."