Remember a few years ago when Michael Cohen was locked up in the federal pen while Michael Avenatti was on an endless media tour promoting himself as Trump’s worst nightmare? We’re probably just a few months away from seeing those roles reversed.

We live in an age of miracles, my friends.

Cohen had been serving time in Otisville but was released earlier this year due to the pandemic, as he has underlying health conditions that might have made him dry tinder for the virus if infected. He was resentenced to house arrest but, being a big dummy, landed on the cover of the New York Post a few weeks ago after he was photographed having dinner at a New York City restaurant. Contrary to popular belief, though, that’s not why the feds sent him back to prison, according to the Times. Cohen ran into trouble a week after his dinner out when he went to the federal courthouse in Manhattan to fill out some routine paperwork related to his home confinement — or so he thought.

Mr. Cohen, who was released from prison in May on a medical furlough, was stunned when probation officers asked him to sign a document that would have barred him from speaking to reporters or publishing a book during the rest of his sentence, his legal adviser said…

As part of his home confinement, probation officers asked Mr. Cohen on Thursday to agree to eight conditions, including “no engagement of any kind with the media, including print, TV, film, books, or any other form of media/news,” according to a copy of the document obtained by The New York Times.

The purpose of the prohibition, the document said, was to “avoid glamorizing or bringing publicity to your status as a sentenced inmate serving a custodial term in the community.”

He’d already announced publicly by that point that he was close to finishing a book about his time as Trump’s “fixer” and didn’t want to forfeit the possibility of an election-year payday by agreeing to postpone publication until after his sentence was served. So he refused to sign the document, with his lawyer claiming it was a violation of his First Amendment rights. Within 90 minutes he was in custody. At that point he agreed to sign — but they wouldn’t let him go, with one marshal allegedly and cryptically saying, “It’s out of our hands,” according to Cohen’s lawyer. Prosecutors claim that he was taken into custody because he was “antagonistic during a meeting with probation officers.”

So Cohen sued for his release, alleging that the Bureau of Prisons had re-incarcerated him as an act of retaliation for threatening to publish matter unflattering to the federal boss of bosses, Donald J. Trump. A hearing was held by phone in federal court this morning, centering on a single question: How unusual is it for the BOP to demand that prisoners under house arrest not publish anything during their sentence? Obviously, as a prisoner, there should be some restrictions on Cohen. As the judge himself said today, no one would argue that he’s entitled to hold a press conference from his jail cell. But what about writing? Were the proposed restrictions on publishing a book standard fare that the DOJ routinely imposes on supervised-release inmates or was this restriction specially crafted for Cohen for illicit political reasons?

Judge Alvin Hellerstein said he’d never seen such a demand from the DOJ in more than 20 years on the bench. Ruling: Cohen is out of prison and on his way back to house arrest as of 2 p.m. tomorrow.

“I’ve never seen such a clause, in 21 years in being a judge and sentencing people,” Hellerstein said at a Manhattan federal court hearing held after Cohen sued this week to win his re-release from prison.

“How can I take any other inference but that it was retaliatory? Hellerstein asked about the condition, which also would have barred Cohen from speaking to journalists or posting on social media…

Hellerstein in ordering Cohen’s release, said that he found that “the purpose of transferring Mr. Cohen from furlough and home confinement to jail is retaliatory, and it’s retaliatory because of his desire to exercise his First Amendment rights to publish a book and discuss anything about the book or anything else he wants on social media and others.”

There are two theories of what happened here. The sinister theory is that, just as Bill Barr’s DOJ engaged in dubious irregular procedures to go easy on Trump cronies Mike Flynn and Roger Stone, it did something irregular here to make life harder for Trump servant-turned-enemy Michael Cohen. Maybe the “no books” clause in Cohen’s contract was inserted there on orders from Barr, seeking to silence someone with dirt on the president who might damage him ahead of the election. Cohen’s court filing ahead of today’s decision promised that his book would “provide graphic and unflattering details about the President’s behavior behind closed doors” and would describe “the President’s pointedly anti-Semitic remarks and virulently racist remarks against such Black leaders as President Barack Obama and Nelson Mandela, neither of whom he viewed as real leaders or as worthy of respect by virtue of their race.” Go figure that Trump lackeys at the DOJ would use whatever leverage they had to try to shut him up.

But there’s another theory, one less obviously sinister (but still sinister). Namely, the feds didn’t single Cohen out, they’re just lazy and don’t much care about the rights of inmates. There’s evidence to support that theory in this case:

Hellerstein may have never personally seen a “no books” clause in a supervised-release agreement before but evidently a “no books” clause has been used in a supervised-release agreement before. It appears that this is boilerplate (although perhaps newish boilerplate) and was adapted for Cohen’s case without anyone involved giving much thought to the fact that trying to muzzle him would look exceptionally shady at a moment when he’s touting a book that threatens to cause electoral trouble for the president.

I’ll leave you with this contentious exchange from “The View” today between Meghan McCain and the author of another prominent Trump-bashing book, the president’s niece Mary. Mary Trump makes the point that if she was looking for a payday she could have written this when he was the superstar host of “The Apprentice”; I’d add that she could have written it in 2016 too. I didn’t think there’d be much public appetite for what she had to say, as Americans outside the MAGA base long ago grasped that the president doesn’t relate to other people in normal human ways. But I’m wrong as can be — she sold 1.35 million copies in a week, Simon & Schuster announced today. Her book is number one in the U.S., the UK, Canada, and Ireland, and number two in Australia. Michael Cohen’s not going to do business as brisk as that with his own book, but he’ll do all right.