Tracking down a Zsh history data loss bug π 0 β² Michael Stapelbergs Website 2 hours ago Β· 23 min read4594 words Β· Tech Β· hide Β· 0 comments For many years, I sometimes discovered that commands I was sure I had run were no longer present in my Z shell history file (~/.zsh_history). In this article, I will show you how I tracked down the bug. Spoiler: ultimately, patching Zsh to make it crash loudly and analyzing the crashβs core dump was the winning strategy! The good news first Zsh 5.9.2 (released July 12th, 2026) contains a fix for this issue β open it after reading this investigation to not spoil the fun. Spoiler: link to the upstream fix Zsh fix 53454 The symptom Occasionally, I noticed that commands I knew I executed the day before were not findable in my shell history, meaning pressing Ctrl+R for backward history search yielded no results. Whenever I noticed this, my shell history file contained only very old entries, with years of newer entries missing. The first few times this happened I just restored my shell history from my daily backup and did not bother investigating any further. But the issue kept happening. Iβ¦ No comments yet. Log in to reply on the Fediverse. Comments will appear here.