Well for one thing if it was referring to the Mosaic law there’d be a major problem because James would probably be contradicting Paul.
We also know because of the entire context of it.
Jam 2:14 What good is it, my brothers, if someone says he has faith, but does not have works? Can his faith save him?
Jam 2:15 If a brother or sister is without clothes and lacks daily food,
Jam 2:16 and one of you says to them, “Go in peace, keep warm, and eat well,” but you don’t give them what the body needs, what good is it?
Jam 2:17 In the same way faith, if it doesn’t have works, is dead by itself.
Jam 2:18 But someone will say, “You have faith, and I have works.” Show me your faith without works, and I will show you faith from my works.
Jam 2:19 You believe that God is one; you do well. The demons also believe–and they shudder.
Jam 2:20 Foolish man! Are you willing to learn that faith without works is useless?
Jam 2:21 Wasn’t Abraham our father justified by works when he offered Isaac his son on the altar?
Jam 2:22 You see that faith was active together with his works, and by works, faith was perfected.
Jam 2:23 So the Scripture was fulfilled that says, Abraham believed God, and it was credited to him for righteousness, and he was called God’s friend.
Jam 2:24 You see that a man is justified by works and not by faith alone.
Note that James mentions works first in verse 14. Then in 15-16, he mentions helping the poor. Then in verse 21 he says Abraham was justified by works when he offered his son Isaac. In other words, he equates works with obedience to God, which is what Abraham was practicing when he offered up Isaac. He also gives another example of a good work, as opposed to works of Mosaic law, in verse 25-26.
So, everytime St. Paul mentions works (usually adding “of the law”) he mentions circumcision, or food laws, or other Mosaic laws. But when St. James mentions works (without adding “of the law”), he mentions helping the poor and being obedient to God. It’s clear what each is talking about.
Additionally, think about the phrase “batting 1000.” Whenever someone today says “batting 1000,” we know that they mean the person they are talking about is having perfect success. In 2000 years, if someone finds some document that says “batting 1000,” what are they gonna think it means? They’ll probably have no idea. Now imagine what would happen if they found a copy of this post which explains what it means.
That’s what happened with “works of the law.” When the dead sea scrolls were found, some of the documents showed that the phrase “works of the law” was an expression used in the time of Jesus to refer to the Mosaic law. It was like finding this forum post.
So we know for sure that the phrase “works of the law” means the Mosaic law. But what if we never found the Dead Sea Scrolls? Well, who would be better to say what the phrase “works of the law” meant? Some German monk living in 1500? Some Protestant living in 2005? Or some fellow living in the years 100 and 200 when the phrase was still being used? Clearly the fellow that lived at the time the phrase was being used. If we look at the early Church fathers, we see that they all took Paul to be talking about the Mosaic law. I think their judgement is best.
Now your friends may point out that sometimes St. Paul simply says “works” without adding “of the law.” He’s still talking about the Mosaic law. You can see this because every time he just says works, he is still using examples like circumcision and food laws. Why does he drop the “of the law” off? Well, if I was writing an essay about George Bush, I might refer to him as “the president of the United States” a lot. But, if I just said that every time, it would get redundany and just sound bad. Paul did the same thing. He didn’t want to just sound like a broken record. Obviously that can be written of as speculation, but the fact remains that the examples St. Paul uses are
always examples of Mosaic law and
never examples of things like helping the poor or abstaining from sin.
In fact, St. Paul gives the strongest warnings in the New Testament about sin. My favorite is from Ephesians 5:5-6, because you can direct it at Protestants and tell them it was written just for them (well verse 6 I mean):
“For know and recognize this: no sexually immoral or impure or greedy person, who is an idolater, has an inheritance in the kingdom of the Messiah and of God.
Let no one deceive you with empty arguments, for because of these things God’s wrath is coming on the disobedient.”