The shape memory effect (SME), microstructures, and mechanical behavior after the deformation at different temperatures were investigated in a solution-treated Co-6.6Al alloy and solution-treated and aged Co-6.5Al-5.4W alloys. The SME in both the solution-treated and aged Co-6.5Al-5.4W alloys without thermal hcp martensite rose rapidly as lowering the deformation temperature, but it rose slightly in the solution-treated Co-6.6Al alloy containing 85% thermal hcp martensite. Regardless of the deformation temperature, the aged Co-6.5Al-5.4W alloy showed the highest SME, and a large recovery strain of 3.9% was obtained. This work clarifies that the SME in the Co-Al-based alloys results also from the stress-induced hcp martensitic transformation. The significant precipitation strengthening of β-CoAl phase is responsible for this remarkable improvement. A higher recovery strain can be expected in other Co-based alloys with hcp martensitic transformation by further strengthening matrix and promoting stress-induced hcp martensitic transformation.