"Grotesque" was written by Howard Gordon, who conceived of the main story after he noticed stone gargoyles on a corner of a New York street he was walking down. The eeriness of the occurrence led Gordon to develop a tale involving possession by a gargoyle spirit. He wrote a draft script for the episode, but the weekend before production began, he had to completely rework it with the help of series creator Chris Carter. During those few days, the two overhauled the script to add more psychological aspects to the episode. Gordon was "very proud" of the final product.