Consciousness is an essential characteristic of the mind, the res cogitans, according to Descartes. In the Meditations the sphere of the mind is grounded in certainty, and this implied consciousness, for there could be no certainty, in the scale that Descartes required, in unconscious processes.
I am a thing that thinks, that is to say, that doubts, affirms, denies ... for as I remarked before, although the things which I perceive and imagine are perhaps nothing at all apart from me and in themselves, I am nevertheless assured that these modes of thought that I call perceptions and imaginations, inasmuch only as they are modes of thought, certainly reside [and are met with] in me.
In the Principles of Philosophy Descartes added the explicit phrase "immediate consciousness".
IX. What thought (cogitatio) is.
By the word thought, I understand all that which so takes place in us that we of ourselves are immediately conscious of it; and, accordingly, not only to understand (intelligere, entendre), to will (velle), to imagine (imaginari), but even to perceive (sentire, sentir), are here the same as to think (cogitare, penser).
Any auxiliary process or faculty which is not conscious, even if related to cognition and thinking, is delegated by Descartes to res extensa, and in particular to the brain. So for example memory, as a capacity to store "ideas" until they are recollected by the mind, is a feature of the brain (!).
Imagine that after leaving gland H, spirits pass through tubes 2, 4, 6, and the like, and into the pores or intervals that occur between the filaments composing part B ... of the brain. And assume that they are forceful enough to enlarge these intervals somewhat and to bend and rearrange range any filaments they encounter ... in such cases these patterns are no longer so easily erased, but are retained there in such a way that by means of them the ideas that existed previously on this gland can be formed again long afterward, without requiring the presence of the objects to which they correspond. And it is in this that memory consists. (Descartes, Treatise of Man)