James made 18 appearances for Barnsley during the 2016-17 season, scoring once, before returning to Leicester.
He has struggled with injuries since then and has only made two senior appearances for the Premier League club in the past two seasons, the most recent against Manchester City in February.
Meanwhile, striker Cauley Woodrow has extended his deal with the club until the end of the 2022-23 season.
Woodrow, 25, has scored 31 goals in 74 league appearances since initially joining on loan from Fulham in August 2018.
He had been linked with a possible move to Championship rivals Cardiff City.
"I know there's been a lot of speculation recently about my future, but as soon as I heard that Barnsley were offering me a new contract it was something I was keen on doing," he told the club website.