Soil shrink–swell behavior is a common phenomenon in farmland, which usually alters the process of water and solute migration in soil. In this paper, we report on a phenomenological investigation aimed at exploring the impact of drying–wetting cycles on the shrink–swell behavior of soil in farmland. Samples were prepared using clay loam collected from farmland and subjected to four drying–wetting cycles. The vertical deformation of soil was measured by a vernier caliper, and the horizontal deformation was captured by a digital camera and then calculated via an image processing technique. The results showed that the height, equivalent diameter, volume and shrinkage-swelling potential of the soil decreased with the repeated cycles. Irreversible deformation (shrinkage accumulation) was observed during cycles, suggesting that soil cracks might form owing to previous drying rather than current drying. The vertical shrinkage process consisted of two stages: a declining stage and a residual stage, while the horizontal shrinkage process had one more stage, a constant stage at the initial time of drying. The VG-Peng model fit the soil shrinkage curves very well, and all shrinkage curves had four complete shrinkage zones. Drying–wetting cycles had a substantial impact on the soil shrinkage curves, causing significant changes in the distribution of void ratio and moisture ratio in the four zones. However, the impact weakened as the number of cycles increased because the soil structure became more stable. Vertical shrinkage dominated soil deformation at the early stage of drying owing to the effect of gravity, while nearly isotropic shrinkage occurred after entering residual shrinkage. Our study revealed the irreversible deformation and deformation anisotropy of clay loam collected from farmland during drying–wetting cycles and analyzed the shrink–swell behavior during cycles from both macroscopic and microscopic points of view. The results are expected to improve the understanding of the shrink–swell behavior of clay loam and the development of soil desiccation cracks, which will be benefit research on water and solute migration in farmland.