Naval officer. Born in Tokyo, the son of a vassal of the Shogun and the older brother of novelist Rohan Koda. He entered the Naval Academy in 1872. In 1893, he became a reserve navy lieutenant. He organized the Hokogikai and went to explore the Kuril Islands, which had become Japanese domain under the Sahalin-Kuril Islands Exchange Treaty. Gunji established a colony on the northernmost Shimushu Island to develop fishing grounds. He returned to Tokyo to engage in the Sino-Japanese War. During the Russo-Japanese War, he was captured and imprisoned by Russian troops until he was released and returned to Japan after the war. During World War I, he undertook confidential government assignments in Siberia.