In 1947 Shafir enlisted in the Palmach and took part in numerous activities with its third battalion, including the assault on Metzudat Koach.
Prior to the Six-Day War Shafir was appointed deputy commander and chief of staff to Israel Tal at the 84th Division.
After the war he served as chief of staff of Central Command and in 1969 he was appointed assistant head of the Operations Directorate.
As commissioner, Shafir introduced various policies and protocols that were widely used in the IDF in order to improve the quality of serving police.
[7][8] Yosef Burg accused Shafir of planting a false story in the press in order to help his investigation of Religious Affairs Minister Aharon Abuhatzira, who was suspected of taking bribes.
[8] Shafir eventually admitted that he had leaked false information to the press on the investigation of the government minister, however he rejected all other allegations.