This protocol details a surgical procedure for performing spinal cord surgery and for implanting and securing an optical shank over the spinal cord in rodents.