I've seen people recently saying things about Ronald Reagan committing treason as a presidential candidate, negotiating with the Iranians to keep holding the hostages until he was elected, etc. I've never seen anything like this before, so I was just wondering what merit this claim has.
This theory goes by the name of "October Suprise" because of a book by the same name by Gary Sick. The basic allegation is that William Casey, Reagan's campaign manager who had CIA connections, conducted secret negotiations with the Iranians. Congress investigated this theory in 1992-3 and released a House report and a Senate report that the evidence for the theory wasn't well founded.
The basics of the hostage deal that ended the Iran Hostage Crisis was that assets of Iran frozen by the US would be unfrozen and that the US would allow the Iranian regime to sue the Shah's family holding assets abroad in exchange for return of the hostages.
In Mark Bowden's book, "Guests of the Ayatollah", interviews with Iranians involved in the hostage negotiations suggest that their motivation to do the deal was that they needed the frozen funds for military equipment for the war with Iran Iraq that started in September 1980 (i.e. before the U.S. election). Iran made several last minute overtures to the U.S. before the election day which were refused by the Carter administration because they were not in U.S. interests, even though a deal would have profited Carter politically. Negotiations by the Carter administration continued for the three months between the elections and Reagan's inauguration. Carter's hand in negotiations was strengthened by the fact that Reagan was not guaranteed to continue negotiations and his public remarks implied (without stating) he might consider a bloody military reprisal. Bowden's interviews with Iranians involved suggest that they decided to delay the deal's completion until the last moment as a deliberate effort to insult and humiliate the Carter administration they had opposed for several years.