juliantaylor/ipython — comment on commit e68660659803dfc67b3d05e89f8b3013f6a11cae
File: IPython/frontend/terminal/interactiveshell.py line 241
By juliantaylor:

good point, although it will only delete the history of raw_input in some situations, there is no reason to save that at all.
Moving _replace_rlhist after run_cell should do the trick