When the messengers of Yama take the dead person to the abode of Yama, they are confronted with Chitragupta, by whom their good and bad actions are recorded. Yama calls upon him to read the accounts of their deeds. When the account is read out, a balance is struck. If the balance happens to go against any person, he is tåken to hell, where he is tortured by the supervisors. The devotees of the Lord are not harassed. Some believe that Chitragupta is only one person who keeps an account of both good and bad actions. But there are others who think that Chitra and Gupta are two persons. One records only good actions and the other records only bad deeds. See : Yama
References :
1. Kohli, Surindar Singh (ed), Dictionary of Mythological References in Guru Granth Sahib, 1993