When a fan started filming during a "Hamilton" performance on Wednesday, Lin-Manuel Miranda called her out in a clever way – seamlessly mentioning the perpetrator in a rap mid-performance.

The musical is in the midst of a special three-week run in Puerto Rico, with the show's creator reprising his role as Alexander Hamilton. In the middle of one of his character's signature songs, Miranda spotted a theater-goer who broke the cardinal rule: no filming during the show.

On the fly, he ad-libbed a lyric in the song "My Shot," The BBC reported. Miranda later tweeted about the moment.

Get Breaking News Delivered to Your Inbox

"LADY FILMING IN THE 4th ROW, PLEASE STOP IT, I gotta holler just to be heard..." he rapped, according to his tweet. The clever diss replaced the line, "The problem is I got a lot of brains but no polish," and then he picked right up with the next verse.

"Please don't make me do that s**t again," he added in the tweet.

Hamilthought, Show #7, 1/16/19

2nd "rewrite":

"I'm a get a scholarship to King's College

I probly shouldn't brag, but dag, I amaze & astonish,

LADY FILMING IN THE 4th ROW, PLEASE STOP IT,

I gotta holler just to be heard..." Please don't make me do that shit again. — Lin-Manuel Miranda (@Lin_Manuel) January 16, 2019

In another tweet, Miranda said his co-stars on stage were taken aback by the edited lyric. He also urged audience members to not film – being distracted and then working his frustration into an impromptu rap was stressful, he said.

"Anyway, having to think that fast within My Shot takes a year off my life, please just enjoy the show," Miranda wrote. "Otherwise you were the best crowd we ever had!"

Miranda has addressed the issue before, calling out audience members who film "bootleg" versions of the show.

Tagging me with bootleg footage from my show is like showing Patti LuPone the video you took of her during Gypsy. Ya dig? — Lin-Manuel Miranda (@Lin_Manuel) February 27, 2014

When someone rebutted that people who videotape the performance are making the show accessible to those who can't afford to see it, Miranda hit back in a tweet, saying, "Sorry, I don't accept that premise: a bootleg, w terrible audio and shaky visuals doesn't preserve my work, it MISrepresents it."

In most theaters, an audience member can get kicked out for breaking the rules. When you're in Miranda's house, you're subjected to a diss track if you step out of line.