I'm trying to define something like the named theorems in Customizing theorem name except using thmtools.
As far as I understand, the headspec is to be provided in the key headstyle to \declaretheoremstyle. However, the following mwe produces the error
Illegal parameter number in definition of \thmt@tmp. ...eadstyle={{\thmnote{#3's }#1}}]{namedStyle}
Of course I could use \newtheoremstyle instead of \declaretheoremstyle, but I would prefer not to, since I'm using thmtools anyway, and would rather not repeat the built-in defaults when possible. And the thmtools syntax just looks generally cleaner.
\documentclass{minimal}
\usepackage{amsthm}
\usepackage{thmtools}
\declaretheoremstyle[headstyle={\thmnote{#3's }#1}]{namedStyle}
\declaretheorem[style=namedStyle, title = Theorem]{named}
\begin{document}
Now let us present that most famous of all theorems.
\begin{named}[Fred]
All odd numbers are prime.
\end{named}
\end{document}
Most of the mwe is copied from Loop Space's answer to the above question.

#1within#1, this is an error. The What are the values/contents of#1and#3? – May 17 '15 at 08:04\begin{named}is processed,#1is assignedTheorem(as per thetitlekey),#2is assigned the current value of the associated counter and#3onwards are the optional arguments passed. – ronno May 17 '15 at 08:39\declaretheoremstyle. – egreg May 17 '15 at 11:05