Comprehend Languages seems like it should fit
Depending on how strict WotC is about their usage of the word 'cipher'
Let's have the fun of defining what a cipher is, in a cryptographic sense. Although they're colloquially identical, it's important to understand the minor differences between a code and a cipher.
For this answer, I'll be assuming something similar to the definition given by wikipedia. In short, a cipher:
- obscures the content of a message
- works on the text itself, on individual letters or symbols
A cipher would turn the phrase "They've fallen for our trap" into something like "Gurl'ir snyyra sbe bhe genc", for example.
This is the sort of operation that could be justified by a feat -- not every adventurer could sort out alphanumeric substitution, or how to make usable one-time pads.
This is different than a code, which operates on a larger scale. In short:
- A code obscures the content of a message
- A code works on the meaning of the message, by substituting phrases
A code would turn "They've fallen for our trap" into something like "The bird's in the hand".
This is the sort of obfuscation that seems simpler to set up, and could be done by just about any adventurer. It feels unfair to gate this behind a feat requirement, and arguably, the fact that the wikipedia page has a section devoted to "Idiot Codes" seems to back up the gameplay.
When dealing with ciphers, Comprehend Languages seems like it should be a natural fit.
An abbreviated overview of the spell includes
For the duration, you understand the literal meaning of any language.
This spell doesn’t decode secret messages that aren't part of a written language.
While the language on the spell isn't perfectly clear, it seems to strongly imply that it cannot be used to comprehend specifically secret messages that aren't language-based. It would exclude things like Drudic runes, thief's signs, and other pictographic shorthand. It would also rule out languages that don't have a written representation.
Barring those, however, it seems as though it should work to decipher messages. It seems that the most common languages (i.e. Common) do not fit in the category defined above. Furthermore, the linguist creating this cipher will be encoding a message such that, when it's decoded, it comes across in words and sentences.
In cases like this, where the message is obfuscated only by a linguist creating a standard cipher, it seems as though Comprehend Languages should work just fine.
Does it work on Thieves cant?
This is where we run into the difference between ciphers and codes. One changes the letters, and another changes the words.
This affects the information we get out of Comprehend Languages. It works just fine on ciphers but could fall down on codes, where the sentence already has plenty of meaning. It's plausible to assume that Comprehend Languages would only tell you the surface level of the code -- that is, what you've already heard and already understood to be a code.
In the case of a code, you'll be left looking for another answer.