Promoted to rear admiral, Godfrey was named director of naval intelligence in February 1939. He energetically set about remedying two decades of neglect. He expanded the division tenfold, enrolling numerous talented civilians; integrated intelligence with the conduct of the war at sea; took full advantage of the ultra cryptographic breakthrough, establishing the decoding center at Bletchley Park; introduced procedures to facilitate intelligence analysis, evaluation, and distribution; and established the Joint Intelligence Committee. Unfortunately, Godfrey's inflexibility caused abrasive confrontations with Prime Minister Winston L. S. Churchill and other colleagues, and in December 1942 he was relieved.
Godfrey then took command of the Indian navy (vastly expanded since 1939), improving its training, recruitment, infrastructure, and staff and enabling the force to contribute substantially to the war in Asia. When World War II ended in August 1945, mutiny broke out in the Indian navy and other military forces, which Godfrey, with Field Marshal Sir Claude Auchinleck, suppressed within a few days. Neither the British Labour government nor Indian nationalists applauded his achievement. Godfrey retired in September 1946 and for 15 years chaired a group of London hospitals. He died at Eastbourne on 29 August 1971.
Beesly, Patrick. Very Special Admiral: The Life of Admiral J. H. Godfrey, CB. London: Hamish Hamilton, 1980.; Godfrey, J. H. The Naval Memoirs of Admiral J. H. Godfrey. 7 vols. Hailsham, UK: Privately printed, 1964–1966.; McLachlan, Donald. Room 39: A Study in Naval Intelligence. New York: Atheneum, 1968.; Montagu, Ewen. Beyond Top Secret Ultra. London: P. Davies, 1977.