Reading the entire letter, we see the works James is talking about:
"
26If anyone thinks himself to be religious, and yet does not bridle his tongue but deceives his
own heart, this man’s religion is worthless.
27Pure and undefiled religion in the sight of
our God and Father is this: to
visit orphans and widows in their distress, and to
keep oneself unstained by the world." - James 1:26-27
14What use is it, my brethren, if someone says he has faith but he has no works? Can that faith save him?
15If a brother or sister is without clothing and in need of daily food, 16and one of you says to them, “Go in peace, be warmed and be filled,” and yet you do not give them what is necessary for their body, what use is that? 17Even so faith, if it has no works, is dead,
being by itself." - James 2:14-17
James says the person who does not have those works--actionable love for others, and doing right--has a faith that is dead, which he says can not save. You say he's not talking about being saved in regard to salvation. But John shows us this matter of loving a brother or sister and doing right, is very much a matter of faith in salvation. He says the person who does not have those works
is not a child of God:
"10This is how we know who the children of God are and who the children of the devil are:
Anyone who does not do what is right is not God’s child, nor is anyone who does not love their brother and sister." - 1 John 3:10
The person who does not have the works James is talking about
is not a child of God.