Moisture causes salt to clump and prevent it from pouring out of the salt shaker. Most commercial salts have anti-clumping agents added so the salt doesn't harden completely, but some clumping is still possible. Sea salts and other gourmet salts may not contain anti-clumping agents, so they are even more prone to hardening. Protecting the salt from moisture keeps the salt flowing and free of clumps.
Store salt containers in a plastic storage bag, whether they are open or unopened. Press the air from the bag and seal it closed. The bag prevents the salt from absorbing moisture from the air.
Place 1/2 tsp. of dry rice grains in the bottom of the salt shaker before adding the salt. The rice absorbs moisture but the grains are too large to come out of the top of the shaker.
Keep salt shakers in a sealed plastic storage container between uses. The container prevents air moisture from entering the shaker holes and clumping the salt.
Place salt in a small bowl near the stove when cooking instead of holding the shaker or salt container directly above the food as you season. The steam from cooking food contains moisture that causes salt to clump.