Stokes was a policy adviser to Liberal Opposition LeaderJohn Brogden, the Member for Pittwater. When Brogden resigned in controversial circumstances, the 2005 by-election was won by independent candidate Alex McTaggart in what many described as a shock result. Pittwater had long been reckoned as a classic "blue ribbon" Liberal seat. Less than two years later, Stokes regained the seat for the Liberals at the 2007 general election. He won the seat with 50.3 per cent of the primary vote, just over the 50 per cent threshold required to win the seat outright, and 59.4 per cent of the vote on a two-party preferred basis. After the election, Stokes established his electorate office in Mona Vale. Stokes paid tribute to John Brogden in his inaugural speech to the NSW Parliament on 31 May 2007. At the 2011 general election, Stokes was re-elected with a swing of 21.7 points, gaining 84.5 per cent of the two-party vote. Stokes' main competitor was the Greens Jonathan King. Following the election, Stokes was appointed as NSW Parliamentary Secretary for Renewable Energy in the O'Farrell government. Owing to the resignation of Barry O'Farrell as Premier, and the subsequent ministerial reshuffle by Mike Baird, the new Liberal Leader, Stokes was appointed as Minister for the Environment, Minister for Heritage, and Assistant Minister for Planning and appointed as a member of cabinet. Two weeks later, following the resignation of Mike Gallacher, Stokes was appointed as Minister for the Central Coast. Following the 2015 state election, Stokes was sworn in as the Minister for Planning on 2 April 2015 in the second Baird government. Following the resignation of Mike Baird as Premier, Gladys Berejiklian was elected as Liberal leader and sworn in as Premier. The first Berejiklian ministry was subsequently formed with Stokes sworn in as the Minister for Education with effect from 30 January 2017. Following the 2019 state election Stokes was appointed as the Minister for Planning and Public Spaces in the second Berejiklian ministry, with effect from 2 April 2019.
Climate Change
Stokes introduced a controversial bill in October 2019, following a concerted lobbying campaign by the NSW Minerals Council to stop planning authorities from considering the climate pollution of exported Australian coal when determining new mining projects. The introduction and consideration of the bill to roll back existing environmental protections was during a period of ‘catastrophic’ bushfire danger throughout New South Wales. Paul Stein QC, a former Supreme Court judge and environmental law expert has warned NSW's push to stop greenhouse gas emissions being considered in mining decisions is a "dangerous retrograde step".