In Semachot, a tractate on the laws pertaining to people on their deathbed, mourning and funeral rites (750 CE), the following parable can be found:
Semachot de Rabbi Hiya 3: the robbing slaves (translation Lieve Teugels)
Rabbi Nathan would tell a parable about a king who built a palace, and he put in it male and female slaves. He gave to them gold and silver to do business with. And he commanded them and said to them: beware that you don’t rob and plunder and steal from each other. The king went to a province of the sea (למדינת הים). The slaves started to rob and plunder and steal from each other. After some time the king came back from the province of the sea. He found all that they had inside and they would stand outside naked. And the king took all the stolen and plundered goods from their hands. So are the wicked ones in this world, they rob and plunder and steal from each other, and when they die, nothing will leave with them, but they will leave naked from mitsvot and naked from good deeds, as it is said: “Do not be afraid when a man becomes rich, When the glory of his house is increased; For when he dies he will carry nothing away; His glory will not descend after him.” (Ps 49:16-17).
According to this peculiar, almost funny, story the slaves of a king start to rob and plunder from each other directly after the departure of their master, the king (the theme of absente ero – the absent master – that we find in many Christian and rabbinic parables). When the king comes back all the stolen goods are in the palace, while the slaves stand outside naked. How should we imagine this situation, one might wonder. Had the slaves agreed to leave the goods in the palace alone? Or did all the slaves hide their stolen goods in the palace, even each other’s clothes? Although the image of naked slaves outside a palace that is full of clothes and other goods might be rather humorous, the application of the parable is not. The slaves are compared to people who increase riches and glory during their lifetime. When they die – the theme of Semachot – those people will stand outside their ‘palace’ (the world) naked. Instead, the parable suggests, one should store up “treasures in heaven, where moths and vermin do not destroy, and where thieves do not break in and steal” (Matthew 6:19; compare the New Testament parable of the Rich Fool: here and here).