Shōnagon (少納言) was a counselor of the third rank in the Imperial court of Japan. The role dates to the 7th century. This advisory position remained a part of the Imperial court of Japan from the 8th century until the Meiji period in the 19th century. This became a Taihō Code office in the early feudal Japanese government or daijō-kan.