Thanks for the information.
It sounds like he might have been a feral kitten, and some ferals never become really tame and never live completely comfortably in close proximity to humans. Also, many declawed cats become biters. With their first line of defense -- their front claws -- gone, all they have to protect themselves from a perceived threat is their teeth.
Mogley doesn't hate you! But, even after two years, he still might be a bit afraid of you. When you're lying down, you seem like less of a threat to him.
Here are some things to try:
-- When you're approaching an area where he usually attacks you, say his name and let him know you're coming. He'll be less likely to be startled and feel trapped and like he needs to attack if he knows the approaching footsteps really do belong to you.
-- Try playing with him with an interactive "wand" or "fishing pole" toy. That's a great way to win a cat's friendship without getting too close for the cat's comfort.
-- Try lying on the floor with him or lying on the couch with one arm hanging over the couch. He might approach you for some cuddles and friendship. Reward him for coming around with some treats. If he's aggressive and bites or scratches when you move, have the treats in your hand and just drop them on the floor rather than moving your hand and arm to get the treats out of the bag. That's sort of providing him with a moving target.
-- Don't ever approach him. Let him approach you.
-- Bach Flower Remedies can take the edge off his anxiety and aggression. You can match the remedies to his personality and situation, and you can mix as many as four together in an ounce of spring water. Most health food stores sell Bach Flower remedies. I like to mix the remedies into the fur on the top of the cat's head between his ears.
-- Make sure he has lots of interesting things to do. Keep some blinds and curtains open so he can see outside. And, if you can, put a bird feeder or two outside a window. His aggressive behavior might be due partly to boredom.
-- Floor-to-ceiling cat trees are a great stress reliever for indoor cats because climbing to the top burns some energy. Try to find one with a house or cubby partway up, so he can hide there instead of lurking in a corner waiting to attack you when you walk by.
-- If you have a balcony, letting him go out on the balcony will give him some outdoor time that will also be a great stress reliever.
I hope some of these suggestions help.