The Day My Agent Lost Its Memory: A Pi Session-Loss Postmortem A local coding agent named pi lost its entire session history, including a conversation with nearly five million tokens of context, after an npm install command removed the sessions directory during an update. The author, Adl, recovered only a 1.6 GB hermes database and a log file, and argues that local agents are unreliable by design, recommending server-side session storage for durability. The Day My Agent Lost Its Memory: A Pi Session-Loss Postmortem A few days ago my local coding agent pi stopped starting, and fixing that revealed something worse: the entire ~/.pi/agent/sessions/ directory was gone — every conversation, including one with nearly five million tokens of context. This post is the short version of what happened and what it taught me about local agents. What happened pi update broke the install: the npm dependency tree at ~/.pi/agent/npm had been rewritten to contain only extensions, dropping the core package. Reinstalling fixed the CLI — and then the session was gone: Extension "