After the transfer of sovereignty, he was placed in the Greater Djakarta City Military Command with the rank of captain.
Soekarno appointed Syafei as a member of the DPR-GR on 15 August 1960 and then served as Special Minister of Security until 20 March 1966.
In the gang, he assigned them to collect rice and vegetables at Senen Market, which would later be given to his mother and two younger siblings for food.
With the martial arts skills he acquired, Syafei managed to defeat Pasar Senen strongman Muhayar.
In this gang, he ordered vegetable traders, hawkers, street vendors, and construction workers to collect fees of 4 cents guilders from market thugs so that they would not cause trouble.
As commander, he mobilized youth, students, former Heiho and police, and pickpockets to expel allied forces and NICA from Jakarta.
[8] On 11 October 1945, Syafei led the OPI resistance against Allied forces operating in the Senen Market area even though he was ill.
In the battle against the Allied army, he formed an alliance with Haji Darip [id], K.H Noer Alie, and Mat Depok.
On an unknown date, he and his troops moved to Karawang after Sutan Sjahrir ordered the fighters to vacate Jakarta because diplomacy would be carried out between Indonesia and the Allies.
[12][6] After the transfer of sovereignty, Syafei joined the Greater Djakarta City Military Command even though he was illiterate and his rank was reduced to captain.
Therefore, he founded an organization called Corps Bambung Runcing (Cobra) to accommodate his colleagues who were expelled from the military and control bandits in the Jakarta area, especially in Senen Market.
However, if Cobra members perpetrated a crime even though they had received business capital, he punished them with a whip made from stingray tails.
[14] Taking advantage of his work at the Greater Djakarta City Military Command, Syafei organized a crowd to attend the 17 October 1952 demonstration.
[19] His great influence in Jakarta and his expertise in controlling bandit movements made Soekarno appoint Syafei as Special Minister of Security on 24 February 1966.
After Supersemar was signed, Suharto issued arrest warrants for 15 ministers, including Syafei,[a] on 18 March 1966 under the accusation of being involved in the communist movement.
[23] On 18 April 1966, he and 14 other ministers were transferred to the Military Detention Center (RTM) Jl Budi Utomo.
[25][26] After being released from detention, Kostrad offered Syafei two jobs: returning to the military service with the guarantee of a promotion or becoming an ambassador.
[3] Syafei died on 9 September 1982 at Jalan Wijaya 9, Kebayoran Baru, South Jakarta, and was buried at the Kalibata Heroes' Cemetery.