How to delete Copilot CLI session history, and what you lose
One directory per session; find the right one by the id inside, not by its name
GitHub Copilot CLI writes every session to its own directory. Deleting a session means deleting that directory, and the one thing to get right is which directory belongs to which session.
Where the sessions are
${COPILOT_HOME:-~/.copilot}/session-state/<sessionId>/
events.jsonl
workspace.yaml
events.jsonl is the conversation: one JSON event per line. COPILOT_HOME moves the whole tree, and with it the MCP config and hooks.
The directory name is not always the session id. The session.start event in events.jsonl carries the real sessionId and the working directory the session ran in. To find a session, search for text you remember, then confirm with that event:
grep -l "the phrase you remember" "${COPILOT_HOME:-$HOME/.copilot}"/session-state/*/events.jsonl
grep -m1 session.start "${COPILOT_HOME:-$HOME/.copilot}/session-state/<dir>/events.jsonl"
Copilot also keeps a session-store.db next to session-state. It is Copilot's own index, not the conversation, and its row for a session stays after the session's directory is deleted.
How to delete one session
Quit Copilot first so a live session cannot write its files again, then remove the directory:
rm -r "${COPILOT_HOME:-$HOME/.copilot}/session-state/<dir>"
To clear every session, empty session-state:
rm -r "${COPILOT_HOME:-$HOME/.copilot}"/session-state/*
Leave the rest of ~/.copilot alone: mcp-config.json, settings.json, skills and hooks are configuration, not history.
What you lose
The conversation, the commands and file edits the tools recorded in the directory. copilot --resume=<sessionId> can no longer reopen the session. The session-store.db row is not removed with it. Copilot has no undo for this unless you have a backup.
Keeping it searchable instead
deja reads Copilot CLI sessions alongside the other agents' histories into one local index:
curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh deja "Copilot session about the migration"
Indexing and search stay local, credentials are stripped, and deja forget removes a session from the index when you do want it gone. A deleted session stays under the Deleted tab of the screen bare deja opens, and R writes its conversation back so copilot --resume can reopen it.
Where every agent keeps its history · Memory for Copilot CLI · The Copilot CLI format
Found this useful? Star deja-vu on GitHub.