Record each command with its exit code, directory, host, session and duration in a SQLite database.
Limit Your old history file is kept; Atuin keeps its own database alongside it.
2 open-source tools on osfeed do this, in 2 ways. Each entry says how, and where it falls short. Read the tool's page before you rely on it.
Limit Your old history file is kept; Atuin keeps its own database alongside it.
Get notified when a tool adds, fixes or changes a way to command duration, including tools added to osfeed later.