Instead of patching Lmod to hide the cluster modules, you can also use a hook.
Untested code below:
local function visible_hook(modT)
-- modT is a table with: fullName, sn, fn and isVisible
-- The latter is a boolean to determine if a module is visible or not
if modT.fullName:find("cluster/%.") then
modT.isVisible = false
end
end
hook.register("isVisibleHook", visible_hook)
Instead of patching Lmod to hide the cluster modules, you can also use a hook.
Untested code below: