A strategy I have used is to place a distinctive object on the closet bar (such as a hanger for a special item, or a cardboard sheet with a hole cut in it (and a slot to get it on) so it hangs perpendicular on the bar). All clean clothes go on one side, and all dirty clothes go on the other. As long as you don't get your left and right mixed up, this will work perfectly — and even then, the dirty side will likely be recognizable as it contains clothes you remember wearing recently.
Side note: it may be a bad idea to hang worn clothes in the closet, because the moisture and skin flakes may attract pests which will eat the clean clothes as well as the dirty ones. (I forget what the exact critters involved are.)
Another thing I used to use for stashing some clothes is the wire mesh cube storage that's commonly sold to college students. One advantage is that they allow for plenty of ventilation. In addition to putting things on the shelves, you can drape clothes over the edge or hook them on the corner fittings, especially if you assemble the system so that the topmost cubes are open at the top rather than the side.
Another idea I've had, but haven't gotten around to implementing, is to make some sort of marker that I can hang around the hook of a hanger which means “this item has been worn once”, so counting how many markers a hanger has tells you its condition (and none means it's clean). Even if I did this, I wouldn't want to let my clean and dirty clothing be mixed up since it might transfer odors and so on.