Many insurers nowadays offer so-called discount protection.
Discount protection is an addition to your chosen insurance package.
In the event of damage (e. g. personal negligence or damage caused by unknown), the no-claims class remains in place.
Options and conditions depend on individual insurers and your policy. Discount protection cannot be carried over during a switch of insurance.