Barclay attended Dollar Academy where he captained the school's 1st XV to victory against the High School of Dundee in the Bell Lawrie White Scottish Schools Cup final at Murrayfield in 2004. Immediately after leaving school, while still only 17, he was invited to train with the Scotland Squad by Matt Williams, the Scotland coach at the time. After Williams departure as head coach Barclay was not picked for the Scotland squad again until the 2007 World Cup after a run of strong performances for club side Glasgow Warriors. He made his debut versus New Zealand in the pool stages in a mainly B side eventually losing 40–0.
After the 2007 World Cup Barclay started to become involved with the Scotland Squad more and became a permanent starter until the end of the 2011 World Cup. During this time he gained wide recognition from many pundits (including Stuart Barnes and Stephen Jones) as one of the top Openside "fetchers" in the game due to his dominance of the breakdown. Most notably his Man of the Match performance in the Scotland victory of the World Champions South Africa at Murrayfield in the 2010 Autumn Internationals and his role in the "Killer Bs" back row (Barclay, Johnnie Beattie and Kelly Brown) during that years 6 Nations when they were regarded as the strongest back-row combination in the championship. Barclay was also selected in the Pro12 Dream Team at the end of the 2009/10 season.
After Scotland's exit at the pool stages of the 2011 World Cup (the first time in history that they hadn't reached the knock-out stages) Barclay found himself dropped from the Scotland starting XV for Edinburgh flanker Ross Rennie during the 2012 6 Nations Championship. Due to injury to captain Kelly Brown Robinson moved him to blindside flanker where he impressed .
Barclay was picked ahead of Fusaro for Scotland's Summer Tour to Australia and the Pacific Islands by then Head Coach Andy Robinson. He played in the famous victory over Australia in Newcastle but then returned home for personal reasons, missing out on the following victory over Samoa .
After overcoming a series of injuries at the start of the 2012–13 season Barclay regained his form for Glasgow at the end of the season and started most games whilst Fusaro suffered with injury. It was announced in the second half of the season that Glasgow had controversially reneged on a contract offer and that On 22 April 2013, Barclay would join the Scarlets on a three-year contract for the next season.
He helped Glasgow to a third-place finish in the Rabodirect Pro12 and a play-off spot away to Leinster which the Warriors narrowly lost.
Barclay missed Scotland's 2013 Summer tour to South Africa due to requiring surgery. He started the 2013–14 season with the Scarlets and was part of the Scotland squad for the 2013 Autumn Internationals, winning a cap against South Africa at Murrayfield on 17 November 2013, when he came on as a substitute on 64 minutes.
He missed inclusion for the 2014 Six Nations squad despite many believing Scotland lacked a traditional openside flanker. Following the appointment of new Scotland coach Vern Cotter Barclay was not included in any of his Scotland squads in the first year, including Cotter's first Six Nations. However he was picked in the wider 2015 World Cup training squad and earned his first cap since 2013 in the second warm-up match against Italy in August 2015. Although omitted from the final World Cup squad and missing out on that tournament, Barclay was once again included in the Scotland squad for the 2016 Six Nations Championship and started the first four games at blindside flanker, scoring a try in the win over Italy.
In the opening match of the 2017 Six Nations Championship, Barclay was a second-half substitute in Scotland's victory over Ireland at Murrayfield. He started the following week against France, in a game that saw captain Greig Laidlaw get injured. Barclay assumed the captaincy for the final three games of the championship, which included a win over Wales for the first time in ten years. Scotland ended the campaign with three wins from five.