The genesis of the novel was in two "Doctor Who" serials written by Adams, "City of Death" (in which an alien tries to change history at the cost of erasing humanity from existence) and in particular the cancelled serial "Shada", which first introduces a Cambridge professor called Chronotis who is hundreds of years old. He has been living and working at a Cambridge college for centuries, apparently attracting no attention (noting with appreciation that the porters are very discreet). In "Shada", Chronotis's longevity is due to him being a Time Lord, and his time machine is an early model TARDIS. These trademark elements from "Doctor Who" were removed by Adams for "Dirk Gently". "Shada" was cancelled before completion due to a production strike and later released on VHS with Tom Baker narrating the unfilmed segments. The story was also animated in 2017 and released on DVD.