The temporary Commandery (Wuji xiaowei 戊己校尉) in the Western Territories was the headquarters of the military administration of the Protectorate of the Western Territories (Xiyu duhufu 西域都護府) during the Han period 漢 (206 BCE-220 CE).
There was no fix location of the headquarters, but for many decades, it was found in the place of the former kingdom of Fore Cheshi 車師前國 (modern Turfan 吐魯番, Xinjiang). The designation wuji 戊己 seems to be derived from the sexagenary ganzhi 干支 cycle (see calendar), but the combination wuji does not exist (while a proper designation wuyi exists 戊已). Also, there are no other examples that garrisons were numbered in this way. Nevertheless, the use of cyclical signs might be related that the location of the headquarters was from time to time shifted to another place which was then, as some scholars hold, called Wu Commandery 戊校尉 or Ji Commandery 己校尉. Others believe that the cyclical signs wu and ji represent the centre (both representing the process earth, wu the Yang form, and ji the Yin form, see Li 1995), meaning the centre of the Protectorate's administration. Both theories were transmitted by Yan Shigu 顏師古 (581-645), who commented on the chapter on state offices (19 Baiguan gongqing biao 百官公卿表) in the official dynastic history Hanshu 漢書, yet Hu Sanxing 胡三省 (1230-1302), commentator of the Zizhi tongjian 資治通鑒, preferred the first explanation and doubted the "central" theory.
The institution was created in 48 CE. The Commander was assisted by a deputy (cheng 丞) and a cavalry commander (sima 司馬), as well as five lieutenants (hou 侯). In the beginning, the headquarters were located in the city of Jiaohe 交河城 (west of present-day Turfan), and in 21 BCE it was shifted to the northeast to Gaochang Wall 高昌壁. The troops of the garrisons worked on military agro-colonies (tuntian 屯田), and their produce was to feed the Chinese army in the Western Territory as well as the members of envoys. The garrison was mainly entrusted with the defense against the Xiongnu 匈奴.
It was abolished in 16 CE, but revived in 74 CE, but with two garrisons, one located in Jinman 金滿城 in the territory of Rear Cheshi 車師後部 (north of today's Jimsa'r 吉木薩爾), and one in Liuzhong 柳中城 on the territory of Fore Cheshi (today's Lukeqin 魯克沁, county of Shanshan 鄯善縣). A year later, after a heavy raid by the Xiongnu, the Jinman garrison was shifted to area of today's Qitai 奇臺, but soon abolished. In 91 CE, only the garrison of Gaochang remained, but a new one was soon built up in Houcheng 侯城 nearby.
The Wuji headquarters is only recorded once for the Wei 曹魏 (220-265) and Jin 晉 (265-420) periods. The office was abolished in 327, when the Former Liang empire 前涼 (314-376) conquered the territory and created the commandery (jun 郡) of Gaochang 高昌.