When I was thinking about this a bit more, magnets and electrostatics don't work. The peak energy of the barrier is the same in both directions. As the ratchet moved towards the next tooth in the allowed direction, the tooth would get longer and the peak energy of the pawl is the same as the peak energy needed in the disallowed direction. If you were relying on time delay, that would mean it's an inelastic system (I think) and you're losing energy.
However, imagine if there was a set-reset switch for each tooth position. When the tooth passed the pawl, it would be 'set' and lengthen, and stay that way even if it tried to go back. When it went around to the other side, something would 'reset' it, thus shrinking it. You're not doing any work in this lengthening and shrinking.
Imagine if the tooth was on a spring loaded with some potential energy in the contracted position. Latch #1 holds the tooth down until it passes the pawl, at which point it releases it by some disengagement mechanism. After the tooth goes through a half cycle of SHM, latch #2 holds it (all the kinetic energy of the tooth is stored in the spring again) in the lengthened position. After a half rotation of the ratched, latch #2 is released and latch #1 is engaged again, holding the tooth in the short position. Such a system would exist for each tooth. As mentioned before, no work is done.
I have no idea how to construct such a system, though.
Moreover, there is one bit of information for each tooth, and whenever the tooth passes near the switching points, its state must be measured. It looks like Maxwell's demon. However, the information required seems to be so minute here. In theory a switch could be designed such that it evades measurement unless it's about to be switched, i.e. once a latch is engaged, the engager no longer sees it, and when a latch is disengaged, the disengager no longer sees it.
Googling came up with
this page. I suspect this is closely related to where the problem is with the device. The frequency with which one must check the latches is related to random motions of the ratchet, which in turn is related to the temperature. So as usual entropy change and work are intertwined, and you won't win.