You can add comments to the end of tricky commands with the # character. Then at a later date you can search for commands using the contents of those comments, using something like C-r.
Personally, rather than interactively putting comments in my shell input, I prefer to write scripts or take notes in a text file.