Iâ€™m sorry that you have made the unfortunate discovery after the fact. As John suggests, you may want to discuss this with an attorney. You may also want to review the agreement you entered into with your home inspector. In the home inspections I have been involved with over the years, the inspectors are focused on safety issues and making sure things are working properly at the time of the inspection. The inspection and the report are not intended to address code and regulation compliance issues.
@Imogene Thomas. I found out when the distro on the side of my house melted down because it was over loaded. The previous homeowner tied off from that rather than the breaker box. This was not a permit issue, this was a safety issue.
How did you find out the line was run illegally? If the homeowner did the work himself, he may or may not have been required to obtained a permit. I would contact your closing Attorney and find out your options. My understanding is the inspector is only liable for the cost of the inspection amount, unless he missed something that was visible and should have been seen. Inspectors do not check to see if permits were issued for work on a home, that is not under their scope of work. I would have a licensed electrician check the wiring and make sure it is safe and go from there. Good luck.
Home inspectors generally carry "Errors & Omission" insurance to cover this. You may want to check the inspection documents for a Disclaimer Clause regarding liability,. The inspector may not have known that the power was run illegally. While they are very thorough in their inspections, they are not infallible and can miss things.