Cell C22 is scarcely bigger than the narrow bed and table it contains. A bucket in the corner, in Oscar Wilde’s time, turned his “numbered tomb” into a foul latrine. The window is shockingly high, so that the prisoner can see nothing of the outer world but a fraction of sky, and even this freedom is qualified. “With bars they blur the gracious moon and blind the goodly sun.”

This is where Wilde was imprisoned for two years, from 1895. This is where – miraculously, eking out the sheets of paper that were removed every night by warders – he wrote De Profundis. He spent each day in solitary confinement, with nothing but the Bible to read for the whole of the first year. And so did every other inmate.

In Artangel’s momentous new project, Reading jail itself is Exhibit A. The cruciform architecture is insistently ecclesiastical; the cells are unchanged; the silence remains oppressive. In the so-called separate system, prisoners were not allowed to converse, or even to see one another’s faces. They stood in boxes to worship in the vaulted chapel and took their daily exercise, walking round in barren circles, concealed in thickly veiled caps. They must reflect on God and the nature of their crimes.

There are extraordinary moments as you pass among the iron corridors and dank cells

Wolfgang Tillmans has thought hard about this hell. A looped film by the Turner prize winner shows his camera trying hard to see through the windows, registering little more than a bright glare that comes in and out of focus. Tillmans has also photographed all he can see of himself, distorted to something between a botched Soutine and an agonised Freud, in the so-called mirrors used by the last offenders before the jail closed in 2013. Rectangles of blurred metal, these mockeries of mirrors censor the human face. Nothing of life can truly be seen.

Tillmans is something of an exception in that he actually made work inside the prison walls. Other artists invited to contribute have sent pre-existing works, not all of them perfectly suited to the story of Wilde, the campaign for prison reform or, indeed, the agony of forced separation from the beloved (Bosie, in Wilde’s case) that is the subject of some intensely beautiful letters written for display in the cells by Ai Weiwei, Jeanette Winterson and Gillian Slovo, among others.

‘Nothing of life can truly be seen’: Wolfgang Tillmans’s Separate System. Photograph: Marcus J Leith/Artangel

It is by no means certain that Vija Celmins’s trademark nightscapes, for all that they show the dark infinity of the cosmos, perhaps conjuring dreams of freedom, add anything to the sense of lost hope and endless night these cells embody. Roni Horn’s photographs of the roiled surface of the Thames feel almost irrelevant. And although Doris Salcedo’s array of coffin-length tables – one below, one above, sandwiching a layer of soil from which green shoots grow, emerging up through the wood as if reasserting the force of life – have clear associations with confinement, their origin as a memorial to the dead is surely more potent. Salcedo made them to commemorate Colombia’s disappeared.

But there are extraordinary moments as you pass among the iron corridors and dank cells. Nan Goldin has installed a peepshow: one imagines the warders horrified to see Jean Genet’s film about gay prisoners staring back at them through the spyhole. And she has plastered another cell with nude photographs of the mighty German actor Clemens Schick, pin-ups for a gay prison that could never have existed and a reminder (under the crafty eye of Bosie, whose portrait appears like a punctuation mark) of the reason Wilde was jeered as he waited in prison uniform at Clapham Junction for the prison train to Reading.

Robert Gober has created two post-surreal sculptures. A man’s suit, apparently disappearing into the wall, is pierced by an opening through which a full-scale grotto is visible; water trickles down among its sorrowful blue stones. Look down through a hole in the floor and you see the torso of a woman, a bright stream running through her like some butchered Ophelia. One thinks of Charles Thomas Wooldridge, the wife-murderer whose execution is the centrepiece of Wilde’s The Ballad of Reading Gaol.

Sometimes serendipity pleads a case. The free bird lifts into the sky on Félix González-Torres’s poster, which you may take away gratis, leaving prison as the inmates could not. Such a bird becomes emblematic in De Profundis, written in C22 (or C33, as it was known in Wilde’s day). This took the form of a letter, because letters were permitted where books were not. In a letter to her long-dead mother, the South African activist Ruth First, Gillian Slovo remembers that First was not even allowed to write letters. She wanted – tried – to kill herself in solitary confinement. Lifting the lid of a wooden warder’s box upstairs, I found modern graffiti: “You Want to Kill – Yourself”.

‘Like a headstone in the chapel’: the original door to Oscar Wilde’s cell. Photograph: Marcus J Leith/Artangel

Marlene Dumas’s devastating portrait of Wilde, beautiful and mournful, hangs in a cell a few feet from her equally powerful image of Bosie, his pretty face a mask of slyness. Never can Dumas’s paintings have appeared anywhere quite so strange. But Artangel has not made an art gallery out of Reading jail, nor theatricalised this catacomb of suffering. It still appears sinister and harsh, smelling of today’s carbolic.

Of all Artangel’s tremendous projects down the years, this may be the most important, not least because directors Michael Morris and James Lingwood have put so much into it themselves. Here are 1890s mugshots, showing the people of the past in fear, defiance, apology, some already filthy from incarceration, others “with crooked arrows starred”. (The Ballad is always in your head.) Here are images of the children who starved; news of the warder sacked for feeding a child. Here is Wilde’s pamphlet on cruelty to children.

Having opened the prison to the public for the first time, Morris and Lingwood bring Wilde back into it as a living force. His words are everywhere. The small door of his cell stands like a headstone in the chapel, carved with its Cyclops eye. It isn’t hard to imagine Wilde’s hand on the wood, as so many others have left their mark (I love Mary, 10 days left). He knew the back of it by the inch, and now you know it too. The jail is astonishingly timeless.

And so is Wilde himself, of course. How perfectly he would have understood the redemption of history through art, the idea of installation art, of places and sounds as commemorations. How seamlessly he would have joined the cast of performers – Neil Bartlett, Ben Whishaw, Ralph Fiennes, Ragnar Kjartansson, among others – reading De Profundis in jail. They will do this every Sunday in the chapel to a fully visible audience. How Oscar Wilde would have loved it.

• Inside: Artists and Writers is at Reading prison until 30 October

