Introduction¶
In DeepSeek Harness (DSH), file tools and terminal sandboxes usually only recognize the root directory of the current workspace. When multi-repository collaboration, shared libraries, or configuration directories are placed outside the workspace, the agent cannot see the path and cannot legally read or write to it. Manually adjusting the sandbox whitelist is costly and prone to inconsistencies where different rules are written for the official sandbox plugin.
dsh-workspace-folders turns “attached folders” into a workspace-level capability: managed via right-click in the sidebar workspace, persisted to a local state file, and fed to both the file sandbox and terminal sandbox simultaneously through the unified sandboxPolicy.resolve(). The model can also operate on the same list via runtime context and dedicated tools. Below is an introduction to its positioning, capabilities, and usage.
What is it¶
dsh-workspace-folders is a community plugin maintained by jkm6221, categorized as a Client (containing both host logic and Web client UI). One-sentence positioning: attach multiple directories to a specific workspace in the sidebar; after attachment, they are equally readable and writable as that workspace and appear in the model context.
- Directory page: https://www.skillhub.cn/plugins/jkm6221/dsh-workspace-folders
- Source code: https://github.com/jkm6221/dsh-workspace-folders
Core Features¶
Workspace-Level Entry¶
Select “Attach Folders…” from the “⋯” menu on the workspace row to add or remove directories in the popup menu. The menu item is registered via the official menu registry ctx.contextMenus.register({ target: 'workspace' }), and the popup is attached to shell.overlay without altering the shell structure.
Sandbox and Permissions¶
Only workspaces already registered in ctx.workspaceRegistry can be attached. The attachment relationship is attached to ctx.sandboxPolicy.resolve({ session }), fetching the list for that specific workspace based on the session header.cwd (workspace root); both dsh-fs-sandbox and dsh-bash-sandbox read the whitelist from the same resolve(), preventing rule inconsistencies on both sides. Sessions switched to another workspace cannot access these directories; after deleting a workspace, attached directories are immediately revoked for writing, and residual records are cleaned up on the next add/remove or plugin load. If the target directory is deleted, authorization is skipped automatically to avoid errors on every subsequent restricted call.
Model Visibility and Tools¶
The plugin provides the runtime context workspace:folders (listing only the current workspace) and the workspace_folders tool, supporting list / add / remove actions. The model operates on data belonging to “the workspace the current session belongs to”; it will explicitly reject requests if the session is not in any sidebar workspace.
Persistence¶
State is saved in $DSH_HOME/workspace-folders.json (default ~/.dsh/workspace-folders.json), bucketed by workspace root, persisting across sessions and restarts. The current format is version: 2; the global list from 0.1.0 (version: 1) is no longer read, and re-attachment is required after upgrading.
Installation and Enablement¶
Install from GitHub (recommended in README):
dsh plugin add github:jkm6221/dsh-workspace-folders
Or install the repository directory as a bundle:
plugin_manager action=install_bundle target=<absolute path to cloned repository>
After installation, both the host side and the client side will hot reload; if the Web GUI hasn’t changed, a refresh is sufficient. package.json specifies Node >=22, DSH version >=0.2.1-rc.1 <0.3, and the license is MIT.
Typical Usage¶
Graphical Interface:
Sidebar workspace row "⋯" → "Attach Folders..." → "Add Folder"
Let the model add it in a conversation:
Add ~/work/shared-lib to the current workspace
The model can call: workspace_folders { action: "add", path: "~/work/shared-lib" }. Removal can be done by clicking “Remove” in the popup list, or by the model executing the corresponding remove action.
Only existing directories are accepted; relative paths are resolved based on the session’s current directory, and ~ is expanded.
Suitable Scenarios and Notes¶
Suitable for: Stable access to shared code, documentation, or build artifacts outside the workspace within a single workspace; wanting file tools and shell to share the same attachment list while allowing the model to see the paths in context.
Workspace Boundaries: Attachment relationships are bucketed by workspace root. They are shared among multiple sessions within the same workspace; switching to another project means they are not visible and cannot be written to. Changing the session’s cd directory elsewhere does not change the affiliation.
Client API: POST /workspace-folders/* on the local loopback, requiring the request header x-dsh-plugin: workspace-folders and carrying the workspace path for the host to validate using the workspace registry; cross-site pages cannot directly construct such requests.
Security Reminder: The plugin runs with the current DSH process permissions, and attached directories will expand the readable and writable scope. Please read the source code and MIT license before installing to ensure the path source is trustworthy. The community directory skillhub.cn is an independent site with no official affiliation with DeepSeek or Hypersphere.
Conclusion¶
dsh-workspace-folders collects “directories outside the workspace” into a manageable attachment list in the sidebar, aligning with the sandbox and model tools, suitable for multi-directory collaboration without the need to modify sandbox configurations everywhere. For more information, see the Directory Page and GitHub Repository.