DeepSeek Harness Session Workspace Isolation Plugin

Introduction

When developing across multiple parallel sessions, intermediate files and final deliverables from different conversations easily get mixed together, making cleanup difficult to distinguish. By default, DSH points all sessions’ working directories to the same location, with no per-session isolation. This article introduces a plugin that creates an independent workspace folder for each new session, keeping process files and final deliverables separate.

About the Plugin

dsh-workspace-session-folders is a DSH host plugin maintained by realzsy. Its core value is assigning each new session a dedicated folder, isolating the session’s working directory from the broader file system for easier management and cleanup.

Core Features

When a new conversation is created, the plugin generates a dedicated folder under the session’s workspace root and switches that session’s working directory into it. The system prompt reports the new working directory, and the session receives a working-directory change notification.

The folder structure is as follows:

<工作区 / workspace>/<YYYY-MM-DD>-<会话ID session id>/
├── process/   过程文件与中间产物
└── output/    最终产物

The session ID determines the folder name, and the generation method is deterministic: after clear / compact, the same folder is reused.

The directory switch is persisted via the working-directory/change event. When a session is restored, DSH handles the directory restoration on its own—no plugin involvement is needed.

Sub-agents inherit the parent session’s live working directory, so they automatically land within the same session folder. Shared tools, assets, and other non-session-specific files can still be placed in the workspace root.

Pre-existing sessions and resumed sessions are not reassigned a folder.

Installation & Activation

Install from GitHub:

dsh plugin --profile <profile> add https://github.com/realzsy/dsh-workspace-session-folders

Install from npm (once published):

dsh plugin --profile <profile> add dsh-workspace-session-folders

<profile> is your DSH profile name (desktop for the desktop edition). After installation, restart DSH or wait for HMR to take effect.

Configuration

Configuration lives in the user’s own profile patch layer cordis.patch.yml, so upgrades won’t wipe it out:

- id: workspace-session-folders
  config:
    enabled: true            # 总开关
    rootName: ''              # '' (默认) = 文件夹直接放工作区根目录;
                              #  填名字如 'sessions' 则在该子目录下嵌套
    subfolders: [process, output]  # 子目录名称;[] = none
    readme: true              # 在会话文件夹写 README.md 存根
    promptSection: true       # 注入文件归放指引到系统提示

Limitations

  • Applies only to newly created top-level sessions; existing sessions and resumed sessions are not reassigned a directory.
  • Session folders are not auto-cleaned; delete them manually when no longer needed (the next clear/compact will rebuild the empty directory structure at the original path if required).
  • Disabling the plugin reverts new sessions to the default workspace root; already-switched session directories remain unchanged.

Use Cases & Caveats

Ideal for scenarios where you need an independent file directory per conversation, such as parallel multi-project work or archiving deliverables by session.

The plugin runs with the current DSH process permissions. Review the source code and license before installing.

Summary

By creating an independent workspace folder for each new session, this plugin maps file management one-to-one with sessions, making it straightforward to distinguish and clean up process files from final deliverables. Installation and configuration are simple, managed via the profile patch layer, and survive upgrades.

  • Directory page: https://www.skillhub.cn/plugins/realzsy/dsh-workspace-session-folders
  • GitHub: https://github.com/realzsy/dsh-workspace-session-folders
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye