How to delete Senpi session history, and what you lose

Each session is a single JSONL file; remove the file, or delete the project folder

Senpi descends from pi and keeps pi's layout: one JSONL transcript per session under its agent sessions directory. Configuration, extensions, and MCP server settings live beside it in the same ~/.senpi/agent tree, so delete only files inside sessions to keep your settings intact.

Where the sessions are

${SENPI_CODING_AGENT_DIR:-~/.senpi/agent}/sessions/<encoded-cwd>/<session>.jsonl

Each project has a directory whose name encodes the working directory with slashes folded into hyphens. Inside it, each session is one JSONL file, and its first line is a header recording the real cwd. SENPI_CODING_AGENT_DIR moves the whole agent directory. Senpi's first run moves ~/.pi/agent to ~/.senpi/agent, so an older machine may still hold transcripts under both roots.

How to delete one session

Close Senpi first so an active session cannot append to its transcript. Then remove the session's JSONL file:

rm ~/.senpi/agent/sessions/<encoded-cwd>/<session>.jsonl

To clear a project's history, remove its directory:

rm -r ~/.senpi/agent/sessions/<encoded-cwd>

To delete every session, remove the sessions directory only. Do not delete ~/.senpi/agent itself: mcp.json and the extensions under extensions/ live there:

rm -r "${SENPI_CODING_AGENT_DIR:-$HOME/.senpi/agent}/sessions"

Delete one session with deja

Run deja last to find the session ID. Preview with --dry-run, then delete:

deja delete <id> --dry-run
deja delete <id>

The dry run lists the target file without touching it. After confirmation, deja removes the JSONL transcript and forgets its own copy from the local index. This cannot be undone. deja refuses deletion if the session file was modified in the last 5 minutes.

Kimchi Coding

Kimchi is another pi descendant with the same JSONL envelope, but a different layout:

~/.config/kimchi/harness/sessions/--<encoded-cwd>--/<session>.jsonl

The project directory name is the working directory with separators replaced by dashes and a -- on each end. deja delete does not cover Kimchi yet, so close Kimchi and remove the file or project directory by hand, as above.

What you lose

The transcript holds the whole session: messages, tool calls with their results, and the header. Once removed, senpi --session <id> cannot reopen it, and nothing recovers it without a separate backup.

Keeping it searchable instead

deja reads Senpi and Kimchi transcripts, along with other coding agents' sessions, into a single local index:

curl -fsSL https://raw.githubusercontent.com/vshulcz/deja-vu/main/install.sh | sh
deja "senpi session about the parser fix"

Indexing stays on your disk, and deja forget removes a session from the index without deleting the source file. Set DEJA_SENPI_ROOT or DEJA_KIMCHI_ROOT to point deja at an archived copy.

Where every agent keeps its history · Memory for Senpi · Memory for Kimchi · The Senpi format

Found this useful? Star deja-vu on GitHub.