Shaw was born in Wellington, and raised by his mother. He attended Wellington High School (1985–1990) and Victoria University of Wellington. Shaw first tried his hand at politics in 1992 standing for the Wellington City Council on a Green ticket. He contested the Western Ward and came seventh out of ten candidates. He later moved to London, living there for 12 years, before returning to New Zealand in 2010. Shaw completed an MSc in sustainability and business leadership at the University of Bath School of Management in 2005.
Prior to returning to Wellington in 2010, Shaw worked in the consulting division at PricewaterhouseCoopers. Between 2011 and 2014, Shaw worked as both a consultant for HSBC bank on "environmental awareness programmes for future leaders" and also at Wellington social enterprise the Akina Foundation.
In the 2011 election, Shaw stood in the Wellington Central electorate, succeeding Sue Kedgley. He came third in the candidate vote after Labour and National, but second in the party vote, beating Labour into third place. He was 15th on the 2011 party list and the highest-placed candidate who did not make it into Parliament.
Shaw has said that in the 2011 Greens selection process, party members "didn't have a lot of time to get to know me" and disregarded him as "an ex-PWC management consultant in a suit". He says he has proved his worth to the party subsequently, and was rewarded with a higher list ranking in the 2014 election. Shaw was one of two Green Party members with significantly increased draft list rankings in March 2014 (the other is Julie Anne Genter).
Bryce Edwards said in The New Zealand Herald that Shaw represented "the more environmentally-focused, non-left side of the [Green] party – what might be called the New Greens faction – people who are more at home in the business world wearing corporate attire than amongst the far left. ... There will be many that see Shaw as a future co-leader of the party."
Shaw was elected to Parliament in the 2014 general election on the Green Party list.
When Russel Norman announced his retirement from the co-leadership position, Shaw was one of the four candidates who ran to replace him. During the campaign, he said that as co-leader he would try and connect with "the 28 percent of voters that considered voting Green last year and didn’t and remove all of the barriers that are currently stopping them voting Green".
At the Green Party AGM on 30 May 2015 he received the highest number of votes, and was elected male co-leader. Shaw won 54 per cent of the first preference votes, compared to Kevin Hague who won 44 per cent (the other two candidates both won 1 per cent).
The day after becoming co-leader, he called for a cross-party consensus on climate change, and said there was room for the Greens and National to work together on the issue. He also said in his first major speech that he wanted the Green Party to be "more like modern New Zealand", and expand its membership both in terms of numbers and to include a more diverse group of people.
Following the resignation of co-leader Metiria Turei due to the political fallout over her benefit and electoral fraud disclosures, James Shaw became the Green Party's solo leader for the duration of the 2017 general election campaign. A female co-leader will be appointed after the Party's AGM in 2018. As party leader, Shaw has called for calm in the wake of hostility among party members towards the media and the resignation of fellow Green Members of Parliament David Clendon and Kennedy Graham in protest of Turei's initial refusal to resign. On 13 August, Shaw announced the Party's new slogan "Love New Zealand" at a relaunch in Auckland.
Shaw believes that the market can be reformed to incorporate sustainability within its normal operations. In an interview with the Aro Valley Valley Voice he put forward his views:
Shaw is one of the new breed of Green MPs who have no problem with leader Russel Norman's statement that the party is 'pro-market'. The fuss around that statement, he says, came from "people who are afraid of the word 'market' because of the switch to a free market economy over the last 30 years" – people, in other words, who don't understand that properly functioning markets can serve the wider good.
Shaw and his wife live in Aro Valley.