Use a custom history file for REPL commands.
Section: Watch Mode, Test Runner, and REPL
Persist REPL history
bash
bash
NODE_REPL_HISTORY=$HOME/.node_repl_history nodeExplanation
Helpful when you use the REPL heavily across sessions.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Watch Mode, Test Runner, and REPL