He studied history and geography at the University of Vienna, but finished his studies only in 1921 at the University of Ljubljana.
He is best known for his autobiographic novels, such as Celica (The Cell) on his experience as a political prisoner, and Lesena žlica (The Wooden Spoon) on life during World World War World War II In 1914, Kozak was arrested by the Austrian police because of alleged collaboration with the radical pro-Yugoslav nationalist youth organization Preporod, which had ties with the militant Bosnian organization Young Bosnia, often considered to be terrorist. Immediately after release from prison, he was drafted into the Austro-Hungarian Army and fought first on the Eastern Front and then in the Italian Front. After the war, he settled in Ljubljana, where he worked as a high school teacher.
In 1935, he became the chief editor of the prestigious literary journal Ljubljanski zvon.
As editor, he opened the journal to Marxist and Communist authors, who published their articles under pseudonyms. During World World War II, he collaborated with the Liberation Front of the Slovenian People.
In 1942, he was arrested by the Fascist authorities of the Italian-occupied Province of Ljubljana. After the Italian armistice, he joined the Partisan resistance.
After the war, he dedicated himself to writing.
Between 1946 and 1947, he was the chief editor of the literary journal Novi svet (New World). Between 1948 and 1955, he worked as the stage director of the Drama Theatre in Ljubljana. He died in Ljubljana.
Slovenian Academy of Sciences and Arts.