The club stated on their website: "Josh, who joined the Seadogs back in September 2019 from Tadcaster Albion, has been a reliable versatile player until a recurrence of injuries saw him ruled out for the majority of the 2021/22 promotion season.
"Barrett, who has played in numerous positions for the Seadogs under various managers, including centre-half, full-back and winger will be missed off the field as one of football's nice guys, with his family regularly attending games.
"We wish Josh a full recovery from his injuries that have troubled him over the past 12 months and hope to see him back on the pitch in the near future.
Scarborough Athletic's home National League North campaign off to a winning start against Hereford
RETRO SPOTLIGHT: 15 nostalgic Scarborough photos from the Scarborough News sports archives
Ebberston battle back to sink hosts Filey in SBL Premier Division thriller
Former Harrogate Town and Bradford City goalkeeper Joe Cracknell returns to Scarborough Athletic
Scarborough Athletic slip to 2-0 defeat at Brackley Town in National League North opener
"Thank you for all your efforts over the past three years Josh."