We are either justified by Faith or we are justified by Works. The scriptures are clear that is Faith not works that saves.
"This instance of Rahab is joined to that of Abraham, either to show, that none of any condition, degree, or nation, was ever numbered among true believers, without good works; or else to prove, that faith, wherever it is sincere and genuine, is likewise operative and fruitful, not only in older disciples and stronger, such as Abraham was, but even proportionably in those that are weaker, and but newly converted to the faith, which was Rahab’s case...
Justified by works; in the same sense as Abraham was, i.e. declared to be righteous, and her sincerity approved in the face of the congregation of Israel, when, upon her hiding the spies, God gave a commandment to save her alive, though the rest of her people were to be destroyed" - Matthew Pool
"Likewise also was not Rahab the harlot justified by works? In the same sense in which Abraham was, showing by her act that her faith was genuine, and that it was not a mere cold and speculative assent to the truths of religion. Her act showed that she truly believed God. If that act had not been performed, the fact would have shown that her faith was not genuine, and she could not have been justified. God saw her faith as it was; he saw that it would produce acts of obedience, and he accepted her as righteous. The act which she performed was the public manifestation of her faith, the evidence that she was justified" - Barnes
"Those are wrong who put a mere notional belief of the gospel for the whole of evangelical religion, as many now do. No doubt, true faith alone, whereby men have part in Christ's righteousness, atonement, and grace, saves their souls; but it produces holy fruits, and is shown to be real by its effect on their works; while mere assent to any form of doctrine, or mere historical belief of any facts, wholly differs from this saving faith. A bare profession may gain the good opinion of pious people; and it may procure, in some cases, worldly good things; but what profit will it be, for any to gain the whole world, and to lose their souls? Can this faith save him?" - Matthew Henry
"After Abraham, the father of the Jews, the apostle cites Rahab, a woman and a sinner of the Gentiles, to show that in every nation and sex true faith produces works, and is perfected by them; that is, by the grace of God working in the believer, while he is showing his faith by his works" - Benson
The context of James and the example usage of Abraham is demonstrating that true faith produces good works.(James 2:26) Faith without works is dead because it reveals a heart has not been regenerated by the Holy Spirit, for if it was then our lives will demonstrate that new life. Faith will become seen by the fruit produced.
Romans 4: 1-6 (NKJV)
"What then shall we say that Abraham our father has found according to the flesh? For if Abraham was justified by works, he has something to boast about, but not before God. For what does the Scripture say? “Abraham believed God, and it was accounted to him for righteousness.” Now to him who works, the wages are not counted as grace but as debt. But to him who does not work but believes on Him who justifies the ungodly, his faith is accounted for righteousness, just as David also describes the blessedness of the man to whom God imputes righteousness apart from works."
It is not works but faith which justifies! “We are saved by faith alone, but the faith that saves is never alone"