Senkokushisho (History Compilation Bureau) (撰国史所)
Senkokushisho was the organization which was established while Japan was under the Ritsuryo system, for the purpose of compiling official history book Rikkokushi (the Six National histories) and "Shin-kokushi" (the New National History).
According to the Japanese Ritsuryo code, compilation of official history book was the job of Zushoryo (the Bureau of Drawings and Books), but it is considered that Zushoryo actually lacked historical materials and human resources necessary to carry out such a job (it is considered that the records and precedents concerning the jobs under the Ritsuryo system were accumulated by Naiki (Secretary of the Ministry of Central Affairs) and Geki (Secretary of the Grand Council of State) for the purpose of future reference). Therefore, court nobles and government officials who were nominated by the emperor were actually engaged in this job. Senkokushisho' was the name of organization that engaged in the lengthy compilation work of Shin-kokushi (unfinished) and the name of the organization that compiled "Shoku Nihongi" (Chronicle of Japan Continued) was 'Senshokunihongisho' (according to "Nihon Koki" (Later Chronicle of Japan) dated March 19, 797). However, there are many instances where the name of the organization was unclear and therefore, 'Senkokushisho' is used as a term that means history compilation bureau in a broad sense. According to the Imperial decree relating to Senkokushisho issued for the purpose of compiling Shin-kokushi as well as "Seikyuki" (exemplary book on Heian rituals) and "Shingishiki" (New Procedures in Administration), compilation of official history was conducted once after the passage of several eras of emperors. High-ranking court nobles like Otodo (minister) or Dainagon (chief councilor of state) were appointed to its head called Betto etc. and Sangi (councilor) class persons were appointed to executive officer. Under them, Geki, who actually handled the records, was assigned and benkan (controller), Confucian scholars and other officials who were versed in kidendo (the study of the histories) joined the team.
Because of its nature, Shenkokushisho was abolished once the compilation work of official history book was completed. In view of the existence of the official history book which described only one emperor, such as "Shoku Nihonkoki" and "Nihon Montoku Tenno Jitsuroku" (fifth of the six classical Japanese history texts), or the one whose compilation work lasted long and eventually stopped without being completed, such as "Shin-kokushi," some people assert that the organization was established intermittently during the period from the late 9th century to the early 10th century.