I recently read a great quote from A. A. Hodge on the matter:
Now, the covenant of works is so called because its condition is the condition of works; it is called also, and just as legitimately, the covenant of life, because it promises life; it is called a legal covenant, because it proceeded, of course, upon the assumption of perfect obedience, conformity in character and action to the perfect law of God. And it is no less a covenant of grace, because it was a covenant in which our heavenly Father, as a guardian of all the natural rights of his newly-created creatures, sought to provide for this race in his infinite wisdom and love and infinite grace through what we call a covenant of works. The covenant of grace is just as much and just as entire a covenant, receiving it as coming from an infinite superior to an inferior" (Popular Lectures, p. 195).I found the quote was on Doug Wilson's blog, to which he added: 'It is called a covenant of works because its condition was one of works, not because its nature was one of works. The nature was of grace -- coming as it did from God's "infinite wisdom and love and infinite grace".'
Now, it would have been an infinite loss to us, an inconceivable danger, if God had determined to keep us for ever, throughout all the unending ages of eternity, hanging thus upon the ragged edge of possible probation, and always in this unstable condition, this unstable equilibrium, able to do right, and liable also to fall; and therefore God offered to man in this gracious covenant of works an opportunity of accepting his grace and receiving his covenant gift of a confirmed, holy character, secured on the condition of personal choice (Popular Lectures, p. 197).
Thus, the covenant of works is also a covenant of grace, because God graciously added a promise to his law. Hodge refers to it as a "Covenant of Life" because the added promise is one of life. If Adam obeyed he would be graciously awarded "a confirmed, holy character."
In a similar way, the condition of the New Covenant is faith, grace is the nature of the covenant (and every covenant), while good works may be considered the fruit of the covenant.