He spoke with a fellow prisoner who had been granted bail and familiarised himself with that man's name and personal details.
When a constable called the other prisoner's name, Thompson stepped forward and said "Yep that's me".
He signed a property receipt and was given the man's bag containing personal items valued at $300 before being released. He was free for 16 days before being caught.
In court yesterday, defence lawyer Peter Birks said there was a "certain irony" in that the charge for which Thompson was on remand when he escaped had since been dropped.
"That's brought home to him the folly of his behaviour."
Mr Birks said the residential treatment programme would be the best option for Thompson.
"[Thompson has] a number of problems that he must face and overcome and he is willing to try and do so."
Judge James Weir told Thompson he was "very lucky to be getting [this] break".
Escaping from custody was in itself a serious matter, the judge said, but stealing the other prisoner's belongings "indicated what sort of low-life" Thompson was.
"You have just got no conscience at all."
Judge Weir ordered that Thompson travel directly to the Hamilton facility on leaving court, warning him if he wasn't there by 4pm he would instead go to prison.
"It's over to you," he said.