Is there a word for a shared idiolect or a dialect understood by only two people?
cryptolect (linguistics) A secretive language form used by a subculture; an arcane cant.
A cant (or cryptolect) is the jargon or argot of a group, often implying its use to exclude or mislead people outside the group.
And there is "argot" also:
An argot is a secret language used by various groups — e.g. schoolmates, outlaws, colleagues, among many others — to prevent outsiders from understanding their conversations.