Yongjia Xuanjue (Chinese: 永嘉玄覺; pinyin: Yòngjiā Xuānjué; Wade–Giles: Yung Chia; Japanese: 永嘉玄覚 or Yōka Genkaku; Korean: 영가현각 or Yongga Hyǒngak; Vietnamese: Vĩnh Gia Huyền Giác), also known as Yongjia Zhenjue (Chinese: 永嘉真覺),[1] was a Zen and TiantaiBuddhist monk who lived during the Tang dynasty. The name Yongjia is derived from the city of his birth, which is now called Wenzhou.[2] He is also known by his nickname "The Overnight Guest" because of his first encounter with his teacher, Huineng. On a visit to Caoxi (漕溪), where Huineng's Nanhua Temple is located, Yongjia was convinced to stay just one night, during which his enlightenment was acknowledged. He supposedly died while meditating in 713.[3] He is best remembered today as the author of the Song of Enlightenment, often known by its Japanese name Shodoka (證道歌).[2][4] This work remains popular in contemporary Zen practice.

Yongjia Xuanjue was born in 665 in present-day Wenzhou in Zhejiang Province, China. The city went by the name of Yongjia at the time, and he came to be named for his birthplace later in life. He began studying Buddhism at an early age as a monk in the Tiantai school and was given the dharma name Mingdao (明道), meaning "bright path". He was friends with Xuanlang (玄朗), who would go on to become the fifth patriarch of Tiantai. He settled at Lung-hsing temple in Wenzhou, where he remained teaching until his death in 713. He was prominent enough that after his death, the Emperor Xuanzong gave him the posthumous name Wuxiang (無象), meaning 'without phenomena'. His two works that survive today are the Song of Enlightenment and the Yongjia Collection.[2]

The story of Yongjia's brief first encounter with Huineng is recorded in the Transmission of the Lamp.[5] The tale tells of one of Huineng's students encountering Yongjia, and through conversation finding that his opinions were very similar to those of the great Zen teachers of the time. When asked who his teacher was, Yongjia replies that he had none, but rather he had attained his understanding from sutras, especially the Vimalakirti Sutra. Huineng's student then explains that one's understanding should be confirmed, to which Yongjia requests that he testify to his enlightenment. The student states that his own personal opinion is meaningless, and he should instead visit Huineng in Caoxi.[6]

Arriving at the temple, Yongjia walks around Huineng three times and then stands staring at him. Huineng comments on his lack of formality, to which Yongjia responds, "Since the question of incessant rebirth is a momentous one and death may come at any moment, I have no time to waste on ceremony, and wish you to give me a quick answer to this problem". Huineng suggests he "embody birthlessness" in order to overcome impermanence. Yongjia immediately displays understanding of this, but then readies himself to leave. Huineng asks if he is not leaving too quickly. Yongjia then says there is no such thing as 'quickly', for motion does not truly exist. Huineng asks why this should be the case, to which he responds that any distinction about quickness or slowness is an artificial construct. Huineng then exclaims that his interlocutor now truly understands the concept of birthlessness, but Yongjia cleverly asks if a mere concept, another form of artificial distinction, can really have a meaning. Huineng asks, "Who makes a distinction about whether there is a meaning or not. Yongjia responds, "Distinctions are meaningless!", and Huineng cries, "Excellent! Excellent! Now, just stay here a single night!" This is so that Huineng can officially confirm his enlightenment. And thus, Yongjia is known as "The Overnight Guest" because he proved his enlightenment to Huineng in one night.[3][6]