Gintoki gets thrown in prison after being framed, and while he's made an enemy of the warden, he's managed to become the boss of the prisoners. With his underling Shachi in tow, Gintoki skips his menial labor duties to search the warden's room for anything incriminating. Understanding that the punishment will be fatal if they are caught, Gintoki disguises himself by putting on pajamas...
This time Gintoki manages to successfully pull off the stunt in the opening, and in the episode itself the Yorozuya are commissioned to help out a brothel with a client who doesn’t pay, having a thing for roleplaying as a prison guard. Gintoki just didn’t expect him to be an actual warden, a corrupt one at that.
So due to this he gets stuck with some false accusations and gets thrown in the slammer, and in his cell he meets an old man with a pretty long sentence who explains that the warden can do whatever he likes here. The old man also bides his time writing letters to his son, however even though he’s been broken the warden uses it as a way of making a bit of extra change on the side. And of course Gintoki can’t just sit back and watch this, so he intervenes by snatching the letter from the old man’s son.
So feeling like he owes him now he tries to take his pudding as payment, but the old man loves his pudding and refuses, telling him that he just wants to make amends with his son and that his letters are all he lives for nowadays. Due to his good behaviour there’s also the chance that his sentence could be reduced but he still has to last one more week, and unfortunately in an attempt to get back at Gintoki the warden has paid off a gang to pick a fight with them. The leader of which Shachi, appears to be one of the prisoners from Katsura’s own prison stunt in episode 110. However by making fun of his fashion sense, blaming it on his underlings, and making it clear he doesn’t squeal, he manages to win them all over and become their boss. And due to this he also gets all their puddings.
Following this the warden attempted to break him and gain control over his prison again, but each attempt was foiled in such a way that made it clear that the warden had set it all up, allowing Gintoki to continually gain more leverage. But after all of this the warden meets him in secret to make an offer, his release in exchange for causing some trouble for the old man, which would have any reductions on his sentence revoked, making him unable to visit his son. However while he still appears to be unsure of what to do, the episode ends with Shachi telling him that the other prisoners could riot and Gintoki announcing that he himself is going to make a ruckus for the warden.