Old Tommy, in desert, cracked code (7)
I believe the answer is:
redcoat
'old tommy' is the definition.
'redcoat' can be an answer for 'tommy' (thesaurus). I'm not sure about the 'old' bit.
'in desert cracked code' is the wordplay.
'in' is an insertion indicator.
'desert' becomes 'rat' (abandon treacherously).
'cracked' indicates an anagram.
'code' with letters rearranged gives 'edco'.
'rat' placed around 'edco' is 'REDCOAT'.
Can you help me to learn more?
(Other definitions for redcoat that I've seen before include "British soldier (hist.)" , "Old-time British soldier" , "Tommy, once" , "British soldier and holiday camp worker" , "British soldier or Butlin's worker" .)