DSH Toolbox

Delete DeepSeek Harness sessions

A DSH session sits three folders deep: $DSH_HOME/sessions/--<project>--/<session-id>/session.v4.jsonl.zstd. The project folder is a readable key built from the working directory — spaces become ~0020, so C:\Users\you\my project turns into --C-Users-you-my~0020project-- — and a session with no working directory lands under _no-cwd/. Deleting an old one is still a file operation, but its entry in workspace.json stays until the index is rebuilt.

Pick the sessions folder inside your $DSH_HOME (by default ~/.dsh). The tool reads file names, sizes and dates locally, then gives you a backup command and a delete command.

Nothing is uploaded. The browser cannot delete anything by itself — the commands are what you run.

Confirm the port is free

Before you start, stop the process that has the port open and confirm nothing answers. Both commands below should print nothing at all.

# macOS / Linux
lsof -i:3080

# Windows
netstat -ano | findstr 3080

Backup, then delete

Copy the whole sessions folder first. It is the only copy of the conversation payloads.

# macOS / Linux
cp -a ~/.dsh/sessions ~/dsh-backup/

# Windows PowerShell
Copy-Item -Recurse "$env:USERPROFILE\.dsh\sessions" "$env:USERPROFILE\dsh-backup\sessions"

Only after the copy finishes. These commands delete the files you selected, nothing else.

# macOS / Linux — replace <project> and <session-id> with the values from the table
rm -rf ~/.dsh/sessions/--<project>--/<session-id>/

# Windows PowerShell
Remove-Item -Recurse "$env:USERPROFILE\.dsh\sessions\--<project>--\<session-id>"

Deleting files leaves their entries in workspace.json. Run Session Index Doctor afterwards to see the gap; restoring the file from your backup is the only documented way to close it.

Want it to clean a whole folder in one click?

Right now you pick files one at a time. If a one-click version would save you time, tell us; we build it when there is enough demand. Send one line; the page still never reads your files.

Send the email — it takes one click

Archive or delete

Archiving is not deleting. It hides a session from the views; the log and the disk usage stay exactly as they were, and the current interface has no unarchive control. Only deleting files gives the space back.

Archive a session instead of deleting it

Why one session grows to tens of megabytes

A DSH session is an event-sourced append-only log: every message, tool call, tool result and approval is appended as a new frame, and the model-facing message history is derived from that log rather than stored beside it. Nothing is rewritten in place, so a file only grows.

The frames are zstd-compressed individually, which is why a 22 MB session can still be a few thousand frames. Tool output is the usual bulk: a single bash result that printed a large file lands in the log verbatim.

Three signals for deciding what can go

Last access time: sessions you have not opened in months are the safest candidates, and the file mtime in this table is that signal.

Workspace membership: a session whose project folder no longer exists on disk cannot be resumed usefully. Session Index Doctor lists exactly these orphans, file on disk with no workspace entry and the reverse.

Single-file size: sort by size and look at the top few. One 30 MB session from a single long debugging run is worth more than fifty 200 KB sessions, and it is also the one a backup will hurt to copy.

Verify the backup before deleting anything

Compare two numbers, not one: how many .zstd files you copied, and the total byte count. If either number is short, the copy was interrupted.

# macOS / Linux
find ~/.dsh/sessions -name "*.zstd" | wc -l
du -sb ~/.dsh/sessions | cut -f1

# Windows PowerShell
(Get-ChildItem -Recurse -Filter *.zstd "$env:USERPROFILE\.dsh\sessions").Count
(Get-ChildItem -Recurse "$env:USERPROFILE\.dsh\sessions" | Measure-Object Length -Sum).Sum

The list entry stays after the file is gone

Deleting a session file does not remove its row from storages/workspace.json, and the per-session cache under storages/session_projcache/ keeps its own row too. That is why a session can show up in the list and fail to open.

Run Session Index Doctor and point it at your $DSH_HOME — it reads both sides and prints the difference. There is no documented rebuild command in the shipped packages, so the honest route after a bad delete is restoring the file from the backup you just verified — which is why the order above matters.

Run Session Index Doctor

What happens to a session that is running right now

Do not delete it. The file is appended to while the agent works, and on POSIX a deleted file stays open until the process closes it, so you can end up with a session that writes to a file no longer in the directory.

Close the session in the UI first, confirm the process is gone, then delete. If you only want it out of the list, archive it with @michengai/dsh-archive-manager; archiving changes nothing on disk, so if the goal is space, deleting the files is the only way to get it.

Common questions

Does archiving free disk space?

No. Archiving only hides a session from the views; the log file and its size stay exactly as they were. The only way to get the space back is deleting files.

After I delete a session file, is it still in the list?

Yes. Deleting the file does not remove its entry from workspace.json, so the list keeps claiming a session whose payload is gone until the index is rebuilt or the file is restored from backup.

Can I delete a session that is running right now?

No. Close the session in the UI first, confirm the process is gone, then delete the file.

Is this the dsh-purge plugin?

No. dsh-purge is a plugin for red-teaming your own setup: it changes prompts and approval policy. This page is a session-file cleanup tool that reads $DSH_HOME/sessions in your browser and uploads nothing.