Where Six AI Coding CLIs Store Your Session Logs A developer's investigation into six AI coding CLIs found that only two document where session logs are stored, with paths and formats varying widely. The tools examined are Claude Code, Codex CLI, Cursor CLI, Amp CLI, opencode, and pi, each writing conversation data to local files or databases, with retention settings only available for Claude Code and Amp. The findings, verified against real files and cross-checked by four adversarial agents, highlight the lack of standardized documentation and the impact of environment variables like XDG_CONFIG_HOME on default paths. I have six AI coding CLIs installed on this machine: Claude Code , Codex CLI , Cursor CLI , Amp CLI , opencode , and pi . Each one writes the full conversation somewhere on disk. Only two of them document where and a single one has full documentation of the format for storing sessions. Last month I published stats from two months of agent-first development https://allaboutcoding.ghinda.com/stats-from-two-months-agent-first-development-using-backoffs/ . Before I could count anything and because I spend almost 100% of my time in terminal, I had to answer a boring question: where does each CLI write its session files? I expected a short lookup in the docs but it was not so simple. Some agents have their sessions location documented, for some others I had to rely on my own machine and inspect. Here is what I found for Claude Code , Codex CLI , Cursor CLI , Amp CLI , opencode , and pi : the paths, the file formats, and the settings that control retention where they exists. All six tools were installed on my machine when I wrote this, so every path below was checked against real files at the end of last month July 2026 . I double checked on another machine with different profile. I also ran the findings through an adversarial pass: four separate agents, each told to refute rather than confirm, each fetching the primary vendor doc and inspecting the real directories. The corrections from that pass are already folded in. Two things came out of it that you should keep in mind while reading: XDG CONFIG HOME=~/.config , which silently moves some of these paths away from their default. I mark those cases so you do not copy my path and wonder why it is empty.Also a note here: I could be wrong about some of the folders shared here because I tried to discover how all this works on my machine. So if you spot an issue please report it to me so I can fix it. | Session log path | Format | Retention setting | | |---|---|---|---| Claude Code | ~/.claude/projects/