At the trial of Antonio Gramsci in 1928, the prosecutor declared: “We must stop this brain from working for 20 years.” Gramsci, the former leader of the Italian Communist Party and a gifted Marxist theoretician and journalist, was sentenced to two decades’ imprisonment by Benito Mussolini’s fascist government.

Yet confinement marked the flowering, rather than the decay, of Gramsci’s thought. He embarked on an epic intellectual pursuit with the aim of an enduring legacy. His Prison Notebooks, as they became known, comprised 33 volumes and 3,000 pages of history, philosophy, economics and revolutionary strategy. Though permitted to write, Gramsci was denied access to Marxist works and was forced to use code to evade the prison censors. In 1937, having long been refused adequate health care (his teeth fell out and he was unable to digest solid foods), Gramsci died, aged 46.

Yet he has achieved the intellectual afterlife that he sought. Gramsci’s Prison Notebooks were smuggled out by his sister-in-law Tatiana and published in Italy from 1948-51. After Gramsci’s work was translated into French, German and English in the 1970s, he became the foremost influence on the anti-Stalinist Eurocommunists. Gramsci is now quoted routinely by commentators who recall his most memorable aphorism (“pessimism of the intellect, optimism of the will”) and his description of the 1930s: “The crisis consists precisely in the fact that the old is dying and the new cannot be born; in this interregnum a great variety of morbid symptoms appear.”

In a 2013 speech, Michael Gove, then education secretary, cited Gramsci in defence of his emphasis on traditional teaching methods (“the ideology he [Gramsci] so feared in inter-war Italy was what we have come to call – with tragic inappropriateness – progressive education”). Gramsci was even claimed by the French far-right group Nouvelle Droite and its Belgian counterpart Vlaams Blok. What accounts for this strange, contested legacy?

The defining Gramscian concept is that of hegemony. This denotes a level of political domination that extends beyond control of a state or a parliament into the realm of culture and ideas. Gramsci was preoccupied by the question of why the 1917 Russian revolution had not been followed by others in western Europe. He located the answer in the persistence of capitalist ideas among civil society institutions (political parties, trade unions, churches, the media). As he wrote: “The state was only an outer ditch, behind which there stood a powerful system of fortresses.”

It was insufficient, Gramsci argued, for revolutionaries to merely wage a “war of movement” (as the Bolsheviks did with their seizure of the Russian state), they had to fight a “war of position”: a long struggle on the terrain of civil society with the aim of changing what the writer called “common sense” (or the “philosophy of non-philosophers”).

In the late 1970s, it was through the prism of hegemony that the magazine Marxism Today analysed the rise of Thatcherism. Former editor Martin Jacques and the late cultural theorist Stuart Hall recognised that the new right was engaged in a project not just to win electoral power but to redefine “common sense”. As Jacques told me: “Most political leaders don’t seek to establish hegemony. The Thatcher experiment was extremely unusual.”

Hall noted the movement’s incessant popularisation of “competition and personal responsibility for effort and reward, the image of the over-taxed individual enervated by welfare coddling”. As Thatcher herself remarked in 1981: “Economics are the method; the object is to change the soul.” Though the right has since made use of the flexible and durable concept of hegemony, Gramsci’s own politics were unambiguously Marxist. The working class Sardinian did advocate a rigorous education in Latin and grammar, but with profoundly different ends in mind to those of the conservative Gove.

Right-wing commentators such as Melanie Phillips and Peter Hitchens have long warned that the left is engaged in a Gramscian march through institutions such as the BBC, universities and schools, trying to effect cultural change. But though New Labour advanced liberal causes such as gay rights, it accepted rather than challenged Thatcherite hegemony.

In Jeremy Corbyn, however, the Conservatives face the first sustained challenge to their intellectual domination. Like the new right before them, the new left aspire not simply to defeat their opponents at elections but to overturn their most cherished ideals. When Corbyn and his allies refer to themselves as “the new political mainstream”, they are, in Gramscian terms, seeking to redefine “common sense”. As Jacques said: “Corbyn is quite unusual in this context. At the last election he was fighting on the high ground; he was revisiting the ground on which the left lost to Thatcherism.”

Gramsci would have admired the activist group Momentum and its festival The World Transformed (which included sessions on such Gramscian themes as lifelong education and political theatre, and a Stuart Hall reading group). As the Prison Notebooks advocated, Momentum seeks full spectrum dominance and engages at the level of civil society and popular culture.

In an era of social media, viral videos and mass higher education, Gramsci’s concept of hegemony feels startlingly prescient. Indeed, he ever more appears not merely a Marxist thinker for our times, but perhaps the thinker.