Is it true as some say that Moses only copied his law from the Code of Hammurabi?
Who was King Hammurabi? Hammurabi was the sixth of 11 kings of the Babylon Dynasty, and around the beginning of the second millennium, a group of Amorites migrated into Mesopotamia and formed a social and political culture, and by the early 19th century BC, Sumu-abum rose to power in Babylon creating a new and powerful Babylonian dynasty of Amorite kings. They concentrated on building canals, temples, defensive fortifications, and creating a strong political and military network among the kings. During this period, Babylon  was surrounded by strong political and military powers of its own, including Elam and Eshnunna to the east, Mari to the west, Larsa to the south, and the Kingdom of Upper Mesopotamia to the north, so in the best interests of the kingdom, King Hammurabi focused on stabilizing society and all of the domestic issues that went with that. The result was a law code was developed that would be among the most comprehensive set of laws and regulations that any nation had ever seen. It came to be called, The Code of Hammurabi.
The Code of Hammurabi
The Code of Hammurabi was ahead of its time, but it was nothing compared to the civil laws and statutes given to Moses by God. This wasn’t really Moses’ law but it was given to Moses and he was associated with it, so the authority or source of the Mosaic Law is different from the Code of Hammurabi because one is from God and one from man (Hammurabi,). Hammurabi’s reasons are self-serving but God’s are for the benefit of the people. Another difference is in regard to social status because the Hammurabi favored the rich, landowners, and slaveholders, while it has a double-standard for the lower classes and regarded the poor and slaves as property and not persons. In God’s law, there is no respect to rich or poor. All are subject to the law. While biblical law sees human life as more valuable than material possessions, the Code treated significant material loss as sometimes worthy of death and God requires a life for a life but the Laws of Hammurabi may only require financial compensation.  God’s law is intended for the longevity of the people but the Code of Hammurabi is designed to keep the king and his kingdom in power. The Code cannot tell a person how to trust in God because “one is [only] justified by faith apart from works of the law” (Rom 3:28), and no amount of civil obedience could ever make one perfect, even though we should still, in this present day, strive to “uphold the law” (Rom 3:31c). The good news is that even though we can’t possibly keep the law as “all have sinned and fall short of the glory of God, [we] are justified by his grace as a gift, through the redemption that is in Christ Jesus whom God put forward as a propitiation by his blood, to be received by faith” (Rom 3:23-25a).
The Mosaic Law
The Mosaic Law didn’t just tell them how to sacrifice animals. The law actually contained many of the things that the Code of Hammurabi had, but as we have seen, God’s law is far superior, and was designed to help the nation survive by doing what God requires and commands. Some of the sanitation laws exceeded those of Hammurabi, and the legal rulings gave true justice in the course of Israel while they regarded the rich over the poor in the Code. The law of God has high regard for human life as compared to the Babylonians, who saw wealth as sometimes more important than human life. The Mosaic Law also reminded the people how ugly sin is. The annual sacrifices, repeated over and over again, were certainly a vivid reminder that sin creates the need for the shedding of blood, and of course, Jesus’ once-and-for-all substitutionary sacrifice  completely satisfied the Father, and Jesus is the only reason we’re acceptable in God (2nd Cor 5:21). The Mosaic Law wasn’t as much about God’s grace as it was a reminder of God’s wrath being poured out on all who reject Him, just as it is on all who reject Jesus Christ (John 3:36b). Not only is a nation cursed that breaks His laws, so is every person that does. God will deal with each person individually someday; either at death or at Christ’s return, but it’s best to settle this today. If you have trusted in Christ, then you’ve already received God’s greatest blessing, but if not, you stand at risk of facing the judgment of God, every single heartbeat.
We have read that there are sharp differences between the Mosaic Law and the Code of Hammurabi, but both actually share in the protection of marriage, family, property damage, injury, murder, robbery, theft, kidnapping and even in commerce, and they both act as stabilizers of society, but for Israel, they constituted expectations from God in how they were to live with their neighbors. God’s law is foundational for the U.S. and other nations as well so that they might rule in relative peace. The main difference is that one is for the prosperity of the king and Babylon while the other is for Israel’s blessings. Prosperity would be a natural consequence of obedience to the laws of God and possibly even the laws of Hammurabi, so it was certainly in the best interest for both nations to obey those laws they lived under. For Hammurabi, it was for political and military purposes, but today, obedience to the civil laws still brings blessings and curses, as in consequences for our actions. Laws are good. They allow us to live, work, and worship in peace. God has said in His Word that we are to obey those in authority, and when we do, we are seen as obeying God, because they’re His appointed agents (Rom 13:1-5), so there are major differences between the Mosaic Law and the Code of Hammurabi, but the chief difference is the Author. One is from God…the other from man.
There is no reason to believe that Moses simply copied some of Hammurabi’s Code. Why would he when he had a far superior law and a Superior Lawgiver? There was no partiality in the law of God, but in the Code of Hammurabi, it wasn’t “what” you know but “who” you knew or how much wealth you had that made all the difference. Thankfully, God is not like man; He is no respecter of persons (Acts 10:34), and He demands we not be either. Hammurabi had regard for the person or their wealth but God regards the person more than wealth, and He looks at the heart (1st Sam 16:7). Hammurabi was looking out for #1; God was looking for His own people, and looking to send One of His Own to die for those He would call (John 3:16). One is self-serving…the other is self-sacrificial. You don’t have to guess which one that is, do you?
Here is a related article for you: What is the Mosaic Law? 
Resource – Scripture quotations are from The Holy Bible, English Standard Version® (ESV®), Crossway Bibles. (2007). ESV: Study Bible : English standard version. Wheaton, Ill: Crossway Bibles. Used by permission. All rights reserved.  Desmond T. Alexander. From Paradise to the Promised Land (Grand Rapids, MI: Baker Publish,