In Revelation, John writes about the "works you did at first" to the Ephesians, and to those in Sardis he writes, "I know your works;...you are dead." What kind of works could John be referring to?
Regarding the admonition to the church at Ephesus to "do the works you did at first," there is a parallel structure that is significant:
"You have abandoned the love you had first. Remember therefore from where you have fallen; repent, and do the works you did at first."
"The love you had" and "the works you did" are clearly paralleled, and cannot be separated.
In Paul's letter to the Ephesians, he praised them for their faith and "love for all the saints" (Ephesians 1). They had obeyed the gospel by believing, and the resulting fruit of that belief was love for God and His people. Many of the believers in all of these churches were Jews. In order to believe the gospel they had to repent of their former "dead works" (ie, self-righteousness under the law, cf. Hebrews 6:1). When some law-abiding Jews asked Jesus, "what must we do, to be doing the works of God?" He answered, "this is the work of God, that you believe on Him who He has sent" (John 6:28,29). A common theme throughout the New Testament is the temptation that Jewish believers, who were being persecuted by the self-proclaimed "Jews" who were of the "synagogue of Satan," had to return to the law after believing the gospel of grace. When John writes here, "repent from where you have fallen," we might consider the connection to Paul's statement to the Galatians that if they returned to self-righteousness and trusting in the "flesh" (ie, their own efforts to keep the law) after having begun by the "spirit," they had "fallen from grace" (Galatians 5).
Regarding the "soiled garments" of those in Sardis (Revelation 3:1f), I believe this also is a reference to self-righteous works. Isaiah says, "all our righteousness are as filthy rags" (Isaiah 64:6). It is only in Christ that we are clothed with "robes of righteousness," and the beautiful "garments of salvation" (Isaiah 61:10).
Notice that the church at Sardis also is admonished to return to what they had "received and heard." Of course what they had received and heard was the same gospel that the Ephesians had received and heard, which had resulted in "the love they had at first." Again, the dichotomy between self-righteousness and faith in the righteousness of Christ by the gospel is emphasized.
This same contrast is evident in the message to the Laodiceans (Revelation 3:14f), who believed themselves to be "rich" but were in reality "poor, blind and naked." And what was the solution for their nakedness? In this clear allusion to the garden scene, the only remedy for the shame of nakedness is the righteousness of Christ. In the garden Adam and Eve tried to cover themselves with garments of their own making, but their shame remained. For as Isaiah says, "their webs shall not become garments, neither shall they cover themselves with their works" (Isaiah 59:6). Shame is always the result of our attempts to "buy" (work for) our own righteousness. But to the church at Laodicea, and to us today, Jesus says, "buy of me ("without money and without price"—Isaiah 55) gold tried in the fire, so you will be rich, and white raiment ("garments of salvation"—Isaiah 61) so you will be clothed, and so that the shame of your nakedness does not appear."
Again, "This is the work of God (i.e., the works you did at first): that you believe on Him Whom He has sent" (John 6:28,29).