Doctor Who: 13 Cool Details Revealed In Steven Moffat's Time Of Angels Commentary
11. The Random Origins Of The Headless Monks
The Doctor's first appearance in the episode finds him poking around an old museum called the Delirium Archive, a place that he describes as "the final resting place of the Headless Monks".
This quick line wasn't in the script; it actually stemmed from a text conversation between Moffat and Piers Wenger, one of Doctor Who's executive producers during the Smith era.
Since the real-life location used for this museum was actually a church, Wenger texted Moffat and asked for some dialogue that would justify why the museum looked so much like a place of religion. Moffat replied with "the final resting place of the Headless Monks", and this made it into the episode.
The Headless Monks then made a physical appearance in A Good Man Goes To War, an episode from the following series.
During the commentary, Moffat doesn't mention this at all, so it seems like this quick line about the Monks was intended to be just that - a quick line - and it wasn't until later on that he decided to turn them into actual characters.