Many neurological and psychiatric disorders are characterized by deficits in cognitive flexibility. Modeling cognitive flexibility in mice enables the investigation of mechanisms underlying these deficits. The majority of currently available behavioral tests targeting this cognitive domain are reversal learning tasks that require scheduled food restriction, extended training periods and labor-intensive, and stress-inducing animal handling. Here, we describe a novel 4-day (4-d) continuously running task measuring discrimination-and reversal learning in an automated home cage (CognitionWall DL/RL task) that largely eliminates these limitations. In this task, mice can earn unlimited number of food rewards by passing through the correct hole of the three-holed CognitionWall. To assess the validity and sensitivity of this novel task, the performance of C57BL/6J mice, amyloid precursor protein/presenilin1 transgenic (APP/PS1) mice, a-calmodulin kinase-II (aCaMKII) T305D knock-in mice, and mice with an orbitofrontal cortex lesion were examined. We found that C57BL/6J mice reach stable performance levels within the 4 d of the task, while experiencing only slight reductions in weight and no major effects on circadian rhythm. The task detected learning deficits in APP/PS1 transgenic and aCaMKII T305D mutant mice. Additionally, we established that the orbitofrontal cortex underlies reversal learning performance in our task. Because of its short duration and the absence of food deprivation and concurrent weight loss, this novel automated home-cage task substantially improves comprehensive preclinical assessment of cognitive functions in mouse models of psychiatric and neurological disorders and also enables analysis during specific developmental stages.