Barrett, who joined from Tadcaster Albion two seasons ago, has been a key member of the Boro side and new boss Jono Greening is delighted with his addition.
He said: "We are really pleased to have Josh on board at the club for the new season.
"He can play in a number of positions, which will be valuable during the campaign."
Keep up-to-date with our exclusive email newsletters.
Subscribe