Problem: Maxwell's Agent (MA) is a thought experiment about whether the second Law is violated at smaller scales. This is a complex problem because the scale dependencies are unclear for perfect gas assumptions, quantum coherence, thermalisation, and contextual measurement. Purpose: The MA is explored from a non-local hidden-variable (NLHV) perspective. Approach: The Cordus theory, a specific NLHV solution, was applied at macroscopic to fundamental scales. Physical realism requires the Agent be included in the analysis. Findings: The primary function is sorting, i.e. a one-time separation of species by some attribute. The thermodynamic MA situation is merely a special case for reducing disorder (entropy). A one-time extraction of energy is possible. This requires input energy, hence the device only has thermodynamic leverage and is not a perpetual motion device. Inefficiencies arise from thermalisation causing short mean free path of Brownian motion, perfect gases having minimal interaction with the gate, ambiguity about spatial location arising from quantum superposition, contextual measurement interfering with the particle velocity, and bremsstrahlung hysteresis losses occurring when the Agent operates. Implications: Entropy is a group property at the bulk level, not a characteristic of the individual particle, and can be reversed at an energy cost at the particle level. Originality: The explanation spans multiple levels from macroscopic down to fundamental, which is unusual. Achieving an explanation from the NLHV sector is novel. The theory accommodates superposition, irreversibility, entropy, contextual measurement, coherence-discord transition, and Brownian motion.