The design of an office can affect productivity and work performance. Though social distraction (acoustic and visual distractions from other co-workers) certainly impacts performance, the effects of the spatial characteristics of the office environment per se are less known. We tested visual enclosure by simply adding a cubicle partition around a desk, and show in two studies that even this minor change improves perseverance, a central function underlying many job tasks. A third study suggests that this effect is likely caused by adjusting the allocation of mental effort depending on the environment, with larger spaces requiring a greater effort allocation. These findings suggest that environmental characteristics affect human performance by influencing the effort allocated to various tasks (effort allocation hypothesis) rather than by activating concepts related to enclosure (semantic priming). Overall, we suggest that visual enclosure in itself could be beneficial in tasks requiring perseverance.