What does it mean to be a sharp cookie? Is it a compliment (because I've never heard of sharp cookie)?
It is not a new expression, according to Ngram it has been used from the '40s. One of the few references available says: (hardly a compliment I'd say)
Sharp cookie: (Wiktionary)
(idiomatic) One who is intelligent, bright, or sharp; especially, one who can identify attempts to deceive or mislead.
- She's a sharp cookie and will have no trouble seeing a sales pitch for what it is.
The following extract from World Association of International Studies adds:
Randy Black writes: In response to WAIS editor-in-chief John Eipper's post, Deborah Dupire-Nelson commented in her 10 June post that she was having a tough time of it finding a definition of one sharp cookie and its origin.
It's my impression that calling anyone sharp is a compliment and that the cookie part of it goes back to the days when we referred to others as cookie, toots, babe, and other diminutive, affectionate terms. In short, being one sharp, or smart cookie is very high praise. One can also be one tough cookie.
In any event, the idiomatic expression means: One who is intelligent, bright, or sharp; especially, one who can identify attempts to deceive or mislead.
- The expression can be found in the Routledge Dictionary of Modern American Slang and Unconventional English 1954.
The meaning is clear, perhaps, but tracing the origin is challenging. Tough cookies are almost as common as sharp and smart cookies, suggesting the key to the etymology lies in tracing the usage of 'cookie' referring to a person. OED chases it back to the 1920's in the US, and suggests that it associated with both women (1920 Colliers Magazine: That girlfriend of yours is a cookie) and men (1942 American Mercury Magazine: Just about the toughest cookie ever born.)
None of the professions that bear the name cookie seem likely candidates - noting that they include not just chefs, but also (according to the Cassell Dictionary of Slang) those who 'cook' drugs or 'books' (crooked accountants). A borrowed foreign word, perhaps Yiddish, is a possibility - but I don't have the resources to follow that through. Tracing back roots in English might lead to 'cuck' (meaning excreta, hence 'cack'), but it doesn't seem to have been in common use for at least a couple of hundred years, and the modern usage (particularly in respect of females) doesn't seem to fit the bill. It is possible that a sharp cookie could refer to a 'clever' crooked accountant (or bookmaker), but again the usual sense is complimentary rather than derogatory.
I think we're left with the weight of (absence of confounding) evidence favouring a derivation from the baked cookie (somehow I'm thinking Yiddish/New York culture again..). A girl could be a 'sweet cookie', and a man could be 'hard-baked' or tough cookie, and somewhere in there might also belong the 'smart' or 'sharp' cookie. It's not beyond the bounds of possibility that the 'smart cookie' may have had something to do with the fortune cookie (see Wikipedia for the history of the fortune cookie) which came into being in the 1890's or early 1900's.