Here's a quick one-line fix for claimable asteroids. Find this code:
for _, a in pairs(mineables) do
if a.type == EntityType.Asteroid then
dist = distance2(a.translationf, ship.translationf)
Don't confuse this with the first occurrence of if a.type == EntityType.Asteroid then since this line comes up twice, the first for resource asteroids (irrelevant here) and the second for generic asteroids, which is the one we want to modify. Replace the middle line with:
if a.type == EntityType.Asteroid and not a:hasScript("entity/claim.lua") then
Anyway, there might be a more performant way to do the same check, but it's good enough for me.