Chitragupta

Chitragupta ('rich in secrets' or 'hidden picture') is a Hindu deity who serves as the registrar of the dead. He is assigned with the task of maintaining the records of the actions of human beings in a register called the Agrasandhanī. Upon the death of a human and their arrival at Yamaloka, Chitragupta reads out their deeds, allowing the god of death, Yama, to decide whether they go to Svarga or Naraka (heaven or hell), depending on their actions on earth. Chitragupta is the seventeenth manasaputra of Brahma. He is believed to have been created from Brahma's soul and mind (chit) and thus is allotted the right to write Vedas like a Brahmin, and also assigned the duty of a Kshatriya.
Literature
Garuda Purana
According to the Garuda Purana, human souls, if not worthy of attaining moksha, receive rewards and punishments according to their sins and merits. The souls of humans following their demise go to Yamaloka, which is presided over by the deities called Yamadutas, who keep records of men's actions and accordingly give them their dues. The principal deity of Yamaloka is Yama — the ruler of Yamaloka, and the king of laws.
The Garuda Purana describes the imperial throne of Chitragupta in Yamaloka, holding his court and dispensing justice according to the deeds of men, as well as maintaining their records.
Yama Samhita
The Yama Samhita, an extract from the 9th chapter of Ahilya Kamdhenu, a work of Hindu Law, says that Dharmaraja complained to Brahma about his difficulties in performing his most responsible duties of keeping records of the deeds of men and doing justice to them. Brahma went into meditation. Chitragupta sprang from his body and stood before him bearing an inkpot and a pen. The god Brahma (creator) said: "Because you are sprung from my body (kaya), therefore you shall be called Kayastha and as you existed in my body unseen I give you the name of Chitragupta. Let the Kshatriya dharma be followed by you and your progeny." He then assumed charge of Yamapuri. Yama setup marriage of his daughter Iravati with Chitragupta. Sraddhadeva Manu, son of Surya, setup his daughter Nandini's marriage with Chitragupta.
Padma Purana
According to Padma Purana, "Chitragupta was placed near Yama to register the good and evil actions of all sentient beings, that he was possessed of supernatural wisdom and became the partaker of sacrifices offered to the gods and fire. It is for this reason that the twice-born always give him oblations from their food. As he sprang from the body of Brahma he was called Kayastha of numerous gotras on the face of the earth."
Bhavishya Purana
Bhavishya Purana states that God, the Creator, gave the name and duties of Chitragupta as follows: Because you have sprung from my body, therefore, you shall be called Kayastha and shall be famous in the world by the name of Chitragupta. Oh my son, let your residence be always in the region of the God of justice for the purpose of determining the merits and demerits of men.
Mahabharata
The Mahabharata (Anusasana Parva, chapter 130) recites the teaching of Chitragupta requiring men to do virtuous and charitable acts and performing yajna, saying that men are rewarded or punished according to their good or bad deeds.
Legend
Chitragupta came into being after Brahma, the creator, having established the four varnas — Brahmin (The Learned), Kshatriya (The Warriors), Vaishya (Merchant & Farmers) and Shudra (Labourer) — ordained Yama to keep record of the deeds — good and evil — of all life-forms born and yet to be born on earth, in the heavens above and in the lands below. Yama, however, complained, "O Lord, how can I alone keep record of the deeds of the beings born into 84 lakh yonis (84,00,000 life-forms) in the three worlds"
Brahma went into meditation for 11,000 years and when he opened his eyes he saw a man holding pen and ink-pot in his hands and a sword girdled to his waist. Brahma spoke: Brahma then enjoined him to dispense justice and punish those who violated the dharma.
In the Garuda Purana, Chitragupta is hailed as the "giver of letters" (Chitragupta namastubhyam vedaksaradatre). In the legends of Chitragupta as well as in the Vedas, he is referred to as the greatest king, while the rest are rajakas, or little kings.
Temples
There are numerous temples dedicated to Chitragupta. Notable examples include:
Chitragupta temple, Khajuraho, Madhya Pradesh
Chitragupta temple, Kayatha, Ujjain, Madhya Pradesh - Chitragupta is said to have been born in human form at Kayatha in Ujjain, which is also an important archeological site with evidence of cultures dating back to more than 4000 years, with a temple dedicated to him.
Chitragupta temple, Kanchipuram, Tamil Nadu - the oldest temple in South India dedicated to Chitragupta. Archaeologist have confirmed based on the inscriptions that the temple was built during the 9th century by the Medieval Cholas.
Chitragupta Devalayam, Falaknuma, Hyderabad - built by Kayasthas employed by the Qutb Shahi's in early 18th century.
References
See also
King Yama
Kayastha
Chitraguptavanshi Kayastha
Hindu gods
Death and Hinduism
Karma in Hinduism
Judgment in religion
Buddhist gods