Preston Crown Court heard the ruse worked as Timothy Joyce was now in a closed prison in Lancashire.
Joyce, who is serving a sentence for drugs offences, hails from the Birmingham area, but was moved to open conditions - which a judge said left him “astonished”, given his criminal record.
The 33-year-old admitted escaping from custody and damaging a woman’s Ford Fiesta.
Prosecuting Hanifa Patel said he was previously convicted of conspiracy to supply class A drugs and was sentenced to seven years and four months by a court in Birmingham.
He arrived at HMP Kirkham on June 10 as part of serving that sentence and is due to be released next year.
But at around 9.30am on June 24, a man on a housing estate close to the jail heard banging noises and saw Joyce acting strangely on his neighbour’s driveway.
She said: “He was clapping his hands and climbing on to the roof of his neighbour’s car.
“Police were called and found Joyce very close by.
“They arrested him and discovered he was a prisoner.”
The court heard £350 damage was caused to the car.
Defending, Julie Taylor said Joyce made the “impulsive” decision to walk out of the prison and get himself arrested deliberately as he was receiving threats over a drug debt.
When he was arrested he told police he was attempting to make his way back to Birmingham.
Judge Philip Parry, imposing five months in jail, said: “You’ve got a really bad record and frankly I’m astonished you were put in an open prison.
“You really have racked up considerable custodial sentences over the last 10 years but nonetheless you found yourself in open prison conditions.
“I’m told you were under threat from other prisoners in the institution. You simply walked out of HMP Kirkham and were detained within an hour or so, having damaged a member of public’s car.”