As Shonagon was defined as the official position to 'report minor matters to the emperor and announce the emperor's messages on minor matters' in the Taiho ritsuryo legal code, Shonagon functioned like private secretaries closely attending the emperor while concurrently holding the position of chamberlain, but the duties of chamberlain were so complicated that their duties of Shonagon were gradually absorbed by their subordinates Geki.
大宝律令では「小事を奏宣す」官と位置づけられ、侍従を兼任して天皇に近侍する秘書官的な役職であったが、侍従の職務の方が繁雑であったため次第に下僚である外記に職掌を奪われた。