Hayes was elected as president of the Students' Union at University College Cork in 2009. He was active in protesting against the re-introduction of student fees by the
government of Fianna Fáil and the Green Party. He was also active in opposing additional fees on students, including printing fees and graduation fees. In 2012, he campaigned for and was employed by the
Barack Obama's re-election campaign as a political deputy in the data team at the headquarters in Chicago. In July 2024, the Social Democrats selected Hayes as their candidate in the constituency of
Dublin Bay South. At the
2024 general election, he was elected to the Dáil, defeating
Chris Andrews to win the fourth and final seat in the constituency. In September 2025, Hayes apologised for a Halloween costume he wore in 2009 of then US President
Barack Obama in which
he wore brown make-up.
Suspension from the Social Democrats in the Dáil following the controversy surrounding his sale of shares of Palantir Technologies. During his employment with
Palantir Technologies, Hayes received 7,000 shares in the company, which supplies artificial intelligence tools to the
Israel Defense Forces. At a press conference on 10 December 2024, Hayes claimed that he had disposed of his Palantir shares before entering electoral politics. However, he acknowledged later that day that he had sold the shares for €199,000 on 26 July 2024, more than a month after his election to Dublin City Council. In a statement, Hayes said: "I unreservedly apologise for providing incorrect information and I am now correcting the record". with deputy leader
Cian O'Callaghan stating: "This is a serious matter. It is imperative that the media, who hold politicians to account on behalf of the public, can rely on the information they receive from elected representatives." On 11 February 2025 deputy leader Cian O'Callaghan confirmed that the national executive of the Social Democrats had completed an investigation into the matter, and chose to "endorse" the parliamentary party's decision to suspend Hayes from the parliamentary party indefinitely. He was not expelled from the party and remains a member of the Social Democrats, with no timeline to return to the parliamentary party. When asked if this meant he was still a Social Democrat TD, O'Callaghan replied: "When we made a decision back in December to suspend his membership from the parliamentary party, he wasn't a Social Democrat TD from that period onwards." On 9 April 2025 it was revealed that the previous day Cian O'Callaghan had written to the clerk of the Dáil saying: "There were 11 Social Democrat TDs elected to this Dáil and, not withstanding internal disciplinary measures, there remain 11 Social Democrat TDs in our party.". This was for the purposes of the party getting to chair an additional
Oireachtas committee as they are apportioned according to party/group size. Without counting Hayes, they would have only received a single committee chair. Hayes's suspension from the party was lifted on 25 July 2025. He donated $51,000 to three charities working in Gaza, with that money representing the uplift in share price from
7 October 2023 to 26 July 2024. Hayes apologised for not divesting sooner and for providing incorrect information to the media and the party. Cian O'Callaghan believed "he should be given a second chance". ==References==