In a town hall event filmed inside New York’s Sing Sing prison that aired Sunday night, “NBC Nightly News” anchor Lester Holt dissected the costs of America’s high rates of incarceration. Joined by singer John Legend, Holt asked prisoners about the toll on their families and their ideas for changing the system.

One topic, though, did not explicitly come up: Trump’s role in signing a bipartisan criminal justice reform bill in December. And the White House’s chief media critic noticed.

In a four-tweet flurry sent late Sunday, Trump lashed out at Holt and “boring musician” Legend — while also swiping at Legend’s “filthy mouthed wife,” model and frequent Trump critic Chrissy Teigen — for not giving him personal credit for his efforts.

“I SIGNED IT INTO LAW, no one else did, & Republicans deserve much credit,” Trump tweeted, referring to the First Step Act, which reduced some federal drug sentences, among other measures. “But now that it is passed, people that had virtually nothing to do with it are taking the praise.”

Legend, a Grammy- and Oscar-winning singer who also founded FreeAmerica, a criminal-justice-reform advocacy group, suggested the president’s ire was misplaced.

Teigen, meanwhile, hit back at Trump with an expletive and wrote that “the absolute best part of his tweet is I literally didn’t speak in the special, nor was I mentioned.”

The president’s voracious TV-watching habits are well documented, as is his zeal to bash coverage he dislikes. But his Sunday tirade is unusual because Trump wasn’t mentioned or criticized during the town hall. In fact, in “Justice for All,” Holt’s special that re-aired just before the town hall on MSNBC, the anchor showed footage of Trump signing the First Step Act, and he reported that it would reduce sentences for many in federal detention. Holt added, however, that the bill “wouldn’t affect more than 90 percent of the U.S. prison population, which is locked up in state and local facilities.”

During the town hall, according to a transcript provided by MSNBC, Holt also discussed a prisoner released under the First Step Act’s reduced sentencing guidelines, and talked about the bill with former Attorney General Loretta Lynch, who called it “a good step” in criminal justice reform. But Trump’s role in signing the bill was not part of the conversation.

Trump has repeatedly complained about not getting credit for the First Step Act, a rare bipartisan accomplishment for his administration. In August, he fumed, “I did criminal justice reform, which President Obama could not get approved, which the media never talks about” — a claim The Washington Post’s Fact Checker ruled as doubly false, noting that The Post and other major newspapers ran front-page stories about the First Step Act and that Obama had earlier reduced other drug sentences in federal prisons.

Trump sounded a similar theme again Sunday night.

“When all of the people pushing so hard for Criminal Justice Reform were unable to come even close to getting it done, they came to me as a group and asked for my help,” Trump tweeted. “I got it done with a group of Senators & others who would never have gone for it. Obama couldn’t come close....”

The president also suggested that his political opponents were now claiming credit for the work while attacking him.

President Trump held a celebration at the White House on April 1 for First Step Act recipients. (The Washington Post)

“Guys like boring ... musician @johnlegend and his filthy mouthed wife, are talking now about how great it is -- but I didn’t see them around when we needed help getting it passed,” he tweeted. “ ‘Anchor’ @LesterHoltNBC doesn’t even bring up the subject of President Trump or the Republicans when talking about … the importance or passage of Criminal Justice Reform. They only talk about the minor players, or people that had nothing to do with it ... And the people that so desperately sought my help when everyone else had failed, all they talk about now is Impeaching President Trump!”

Holt’s town hall grew out of his reporting on endemic problems in the justice system, particularly on the state level. Holt spent two nights locked up in the infamous Louisiana State Penitentiary, better known as “Angola,” for “Justice For All,” which first aired Friday night on “Dateline.”

Sunday’s moderated town hall offered a chance to discuss his findings with prisoners inside Sing Sing. Legend, whose advocacy group has focused on state-level reform in places like Louisiana, noted the negative effect of high prison rates on millions of children and urged Americans to see the “humanity” of those impacted.

“Every dollar we spend on prisons, every dollar we spend on punishment, it’s dollars we can’t spend on education, health care, on the things that make our communities stronger,” Legend said.

Clarification: This story was updated to make it clear that the First Step Act was discussed during Holt’s town hall, but not Trump’s role in signing it.