Hmm .. kinda unclear in my explanation ..

..
You already have a col detection on you floor, cliff or castle wall ... on the very edge just in the same level and a small distance lower you have the "Grabing Zone" ..
If UserOnFloor() && GrabZone() then UserSLipedAndGrabedEdge()
If UserInAir() && GrabZone() then UserJumpedAgainstEdgeAndGrabed()
The hardest and most complicated is constructing those EdgeZones... One idea is to construct a Invisible Box or Tube during Map Creation along the edges where you want the player to be able to do what ever it is you whant em to do...
In the 2D "Mario 1" - clone I did every platform vas a box .. thus it was easy to calc if it was a edge hit or not

...
Hope this was an easier explanation...
But alas I do hope someone with more experience can post a mezz here on how you Realy do it

...
//dARKNER