An animal’s perception of its body size is modified when it adapts its body to changes in a complex environment. This ability is essential for animals that use tools or cross apertures. Here, we show that terrestrial hermit crabs, Coenobita rugosus, which frequently change shells, can perceive the width of the aperture to be crossed, dependent on the shape of their shells. Hermit crabs walked in a corridor that had two different size apertures; most of the crabs with a large shell did not cross the narrow aperture, indicating an awareness of aperture width. Moreover, most of the crabs with a small shell with an attachment did not select the narrow aperture, either. These results are the first demonstration of animals perceiving affordance while carrying objects.