Introduction¶
Running agents in DeepSeek Harness (DSH) for an extended period causes the sidebar to slowly fill up with sessions you’ve only chatted with once. Directly deleting session logs is often difficult to let go, while keeping them blocks the few sessions you are currently looking for. DSH’s built-in rename, fork, and archive functions do not clear these “cold” sessions from view, nor do they provide a buffer period for accidental deletion.
The @wangxiaocuo/dsh-session-trash introduced below adds a local trash layer: it moves cold sessions out of the sidebar while keeping the logs on your machine; they can be recovered during the retention period, auto-cleaned when expired, or manually permanently deleted.
What is it¶
The maintainer is wangxiaocuo, the npm package name is @wangxiaocuo/dsh-session-trash, and it is categorized as a client plugin. The README summarizes it as: A session trash for DeepSeek Harness—right-click to move out of the sidebar, recover anytime during the retention period, or permanently delete logs.
Data is written to <DSH_HOME>/.session-trash/, independent of plugin uninstallation within the profile; uninstalling the plugin will not delete this directory, and it requires manual cleanup if needed.
Core Features¶
Sidebar: Move to Trash¶
Right-click on a cold session in the sidebar and select “Move to Trash”. Moving and restoring only moves the session directory; attachments and images do not move with it. When permanently deleting, the session’s projection cache records and workspace ledger are cleaned up, while attachments and images remain in their original state.
You cannot move a session in if it still has a running turn, job, subagent, or scheduled task. Hidden subagent sub-sessions will be moved in along with the entire tree of the parent session and will return together when restored. If you cannot move a session in, the right-click menu still retains an explanatory item indicating the reason, avoiding silent disappearance of menu items. After moving, a DSH shared Toast is displayed offering only “Undo”; “Undo” restores the session via the normal flow, or performs an orphan recovery if the original workspace directory no longer exists or the workspace has been removed from DSH.
Renaming, forking, archiving, and copying the Session ID still use DSH’s built-in sidebar menu; the plugin does not duplicate this functionality.
Settings Page: Trash¶
The entry point is Settings Page -> “Trash”. Each record displays the session title, Session ID, original workspace, move-in time, remaining days, log size, and status; the inline “Logs” field only counts session logs. It supports search, filtering, and sorting (move-in time / title / size / expiry), with 50 records per page. Entries containing sub-sessions carry a “Contains N sub-sessions” badge; restoration and permanent deletion are handled as a whole tree.
Row actions include restoring, restoring as an orphan session, permanently deleting, removing from index, copying the Session ID, and opening the original workspace in Finder or File Explorer. “Restore as orphan” only appears when you cannot return to the original workspace normally. You can select multiple items for batch restore (only for entries that can return to the workspace normally) and support “Select All” for the current page. The toolbar “Delete All” clears the trash after a secondary confirmation; expired items will also be deleted.
Below the toolbar, local session data breakdown (logs, attachments, cache, etc.) is displayed, and access points for attachment cleanup are provided (requiring preview and confirmation).
Auto Cleanup and Reliability¶
The default retention is 30 days (retentionDays), with a scan every 6 hours (sweepIntervalHours); checks are also performed after the plugin is activated and when the trash page is opened. Whether expired items are deleted is controlled by enableAutoCleanup; cleanup failures retry with exponential backoff, and failure information is displayed on the page.
The index uses atomic writes (tmp, fsync, rename), and the old index is kept as .bak. After a process crash or power outage, unfinished trashing, restoring, and purging operations will either continue on the next startup or roll back. When multiple DSH processes share the same DSH_HOME, .lock is used for serial write operations; status is synchronized between tabs from the same origin via BroadcastChannel.
Installation and Activation¶
Runtime requirements are DSH ^0.2.2-rc.1 and Node.js 20 or higher; it works on both Desktop and Web. Installation and uninstallation are performed by pnpm in the current profile.
Install on DSH Plugin Page (Recommended)¶
- Open the sidebar “Plugins” page and click “Add Plugin” in the top right corner.
- In “Package name or address”, enter the npm package name; if you want to track the latest code in the repository, you can use the Git address instead.
- Keep “Install source” as default, or choose a mirror based on your network conditions; after clicking “Install”, check the pnpm output in “View installation details”.
- After installation, click “Activate Now”; if prompted to restart, restart DSH or refresh the page on the Web side.
Package name and Git install examples:
@wangxiaocuo/dsh-session-trash
git+https://github.com/wangxiaocuo/dsh-session-trash.git
When allowing an Agent to install (requires danger-full-access or separate approval), you can use:
plugin_manager install_bundle target=@wangxiaocuo/dsh-session-trash
plugin_manager install_bundle target=git+https://github.com/wangxiaocuo/dsh-session-trash.git
If you already have a cloned directory of @wangxiaocuo/dsh-session-trash locally, you can set target to the absolute path of that directory. When DSH CLI is installed, dsh plugin add is equivalent to the specifications above.
Upgrade and Uninstall¶
For npm-installed plugins, open the “Session Trash” details on the “Plugins” page and click “Update” in the “Version” section. For Git installs, you must uninstall and reinstall to pull the new code. Uninstallation is confirmed within the same details, and profile dependencies are removed along with it.
Configuration¶
Configure in the plugin line of the profile patch (where id is session-trash):
- id: session-trash
name: '@wangxiaocuo/dsh-session-trash'
config:
retentionDays: 30 # 1-3650
sweepIntervalHours: 6 # 1-168
enableAutoCleanup: true
debug: false
| Field | Default | Description |
|---|---|---|
retentionDays |
30 |
Number of days to keep in trash; auto-deleted when expired |
sweepIntervalHours |
6 |
Auto-cleanup scan interval (hours) |
enableAutoCleanup |
true |
Can still manually permanently delete, but will not auto-clean expired items if disabled |
debug |
false |
Output more detailed diagnostic logs |
If the configuration value is invalid, the plugin will refuse to activate and will not silently fall back to default values; modifying normal fields will restart the plugin.
Typical Usage¶
Daily sidebar cleanup: Right-click a cold session and select “Move to Trash”; you can click “Undo” before the Toast disappears. When you need to recover a session, open the Settings “Trash” page for single restore or select multiple items for batch restore.
If the original workspace directory no longer exists, or the workspace has been removed from DSH, the page will first ask for confirmation; after confirmation, it performs an orphan recovery, and the session returns to “Ungrouped”. To free up space immediately and confirm you no longer need the logs, you can use “Permanent Delete” on a single item, or “Delete All” to empty the trash.
If you cannot move a session in via right-click, the README suggests checking the FAQ first: it is mostly because the session is still in a live state, and you can try again after restarting DSH.
Applicable Scenarios and Notes¶
Suitable for developers who run multiple workspaces and sessions locally with DSH for a long time, but do not want the sidebar filled with historical records, while also wanting to keep local logs for a certain period.
The plugin reads and writes <DSH_HOME> and session directories under the permissions of the current DSH process; it is recommended to read the source code and license (MIT) on GitHub before installation. The community directory SkillHub Plugin Page has no official affiliation with DeepSeek/Huafuan. Its ecosystem positioning is a third-party extension under the philosophy of “everything is a plugin,” and it is not equivalent to a product listed on the official app store.
After following the steps above, the sidebar retains only active sessions, while cold sessions enter a local, recyclable, and auditable queue; you can then restore or permanently delete the logs from the Settings page when needed.
- Community Directory: https://www.skillhub.cn/plugins/wangxiaocuo/dsh-session-trash
- Source Code and Documentation: https://github.com/wangxiaocuo/dsh-session-trash