In reply to mel holmes:
I'd just like to clarify that, if it is cramp, it is your forearm muscles cramping. You don't have any muscles in your hands controlling your fingers, only tendons which connect to your forearm where there is more space. You probably already know this, but I thought I'd mention it just in case.
With any cramp, stretching helps. Forcing it back opening like you did should in theory stretch the affected muscles. Stretching beforehand can prevent or delay the onset and stretching during a cramp can release it and help the muscles recover.
I sometimes suffer from cramps in my legs, usually from dehydration on a hot day when I can't drink enough. I find taking rehydration sachet really helps. I don't know if this would help with arm cramp or not. They are really light to carry, assuming you already have water with you.
On another note, I have a friend you started waking up his hands/arms cramped, which he then has to pry open. I think he was advised to put an elastic band around his fingers and keep opening and closing his hand to work the muscle imbalance that had built up from too much bouldering. The exercise is, in effect, working the opposite of grip strength. Again, I have no idea if this would help in your case or indeed if it will help him.
Mehmet