The episode was originally titled "The Secret Life of Neelix" and was intended to be a story about when Neelix's daydreams take on a life of their own when aliens become involved. However it was shifted around and rewritten to become a story involving the Doctor. The premise is based on the short story "The Secret Life of Walter Mitty" by James Thurber in which Walter Mitty daydreams heroic adventures while running an errand for his wife. The title of this episode is a reference to the 1974 spy novel "Tinker, Tailor, Soldier, Spy" by John le Carré.