Introduction¶
In DeepSeek Harness (DSH), a workspace corresponds to “a project directory + a session running within that directory”. In actual development, these directories often land in batches under the same parent path: dozens of plugin repositories, demos, and sandbox projects are registered side-by-side, causing the sidebar to default to a long, flat list “by workspace”, which incurs high switching and locating costs.
The official sidebar already provides the “Workspace Tree” view (groupBy = "workspace-tree"), which mounts each workspace under the nearest registered ancestor workspace. The difficulty lies in the fact that a tree requires “parent nodes,” but you often only register leaf project directories without creating workspaces for their common parent directories.
The community plugin dsh-plugin-better-folders (Maintainer: huguangyu666, Category: Client) addresses this by registering common parent directories as folder nodes according to rules, allowing the built-in tree view to automatically collect sibling workspaces, rather than rewriting the sidebar UI.
What is this¶
Better DSH Folders is a client-side DSH plugin: it automatically organizes the workspace list, merging multiple workspaces under the same parent directory that meet specific conditions into a collapsible folder node. The visual collapsing and hierarchy are handled by the “Workspace Tree” provided by @deepseek-ai/dsh-client-ui-workspace; the plugin’s role is primarily to register parent directories as workspaces and optionally switch the grouping mode.
What problem does it solve¶
The typical layout in the README is as follows: multiple projects exist under MyProjects or code, and when tiled, each row represents a workspace. After organization, common parent directories become folder nodes, and child workspaces are nested beneath them; paths with only a single workspace remain unchanged.
The working principle can be summarized as:
Merging workspaces with the same parent directory is equivalent to registering that common parent directory itself as a workspace (folder node).
Therefore, the plugin does not override the official UI; it relies on the existing tree view for rendering, avoiding issues like “plugin crash leads to a blank sidebar.”
Core Features¶
Auto/Manual Organization by Parent Directory¶
| Capability | Entry |
|---|---|
| One-click Organize / Preview / Restore | Settings → Plugins → Better DSH Folders |
| Sidebar Quick Organize | 📁 Organize Folders at the bottom of the sidebar |
| Chat Slash Commands | /folders status \| plan \| organize \| unmerge |
| Agent Tools | organize_workspaces (action: status / plan / apply / unmerge) |
| Auto Organize | Automatically merges after workspace list changes (can be disabled) |
| Settings | Namespace better-folders |
Organization rules can be adjusted in settings (defaults are derived from the README):
| Config | Default | Meaning |
|---|---|---|
enabled |
true |
Master switch for the plugin |
autoOrganize |
true |
Auto-organize after workspace list changes |
minChildren |
2 |
Minimum number of sibling workspaces required to merge into a folder node |
maxDepth |
1 |
How many directory levels to trace upward to find a common parent (1 = look only at the direct parent) |
autoTreeView |
true |
Switch sidebar to “Workspace Tree” view after organizing |
keepOrder |
true |
Sort the folder node before its first child workspace |
The plugin applies cascading safeguards to folder nodes it creates; user-manually registered parent workspaces are not subject to this restriction; the root directory (C:\, /) is never turned into a node.
“Tables”: Custom Workspace Collections¶
In addition to merging determined by disk hierarchy, the plugin supports Tables: collections of workspace IDs under custom names. They do not create directories, change cwd, or touch session history. The same workspace can belong to multiple tables; deleting a table does not delete workspaces or sessions. The entry point is the 📋 next to the “Workspaces” title in the sidebar (in the same row as the 📁 organize button; if location fails, it falls back to the bottom “Organize Folders” button).
Slash command examples:
/folders tables # List all tables
/folders tables new 性能对比 # Create a table
/folders tables add 性能对比 titan # Add a workspace (match by path fragment)
/folders tables remove 性能对比 titan # Remove
/folders tables rename 性能对比 A/B # Rename
/folders tables delete 性能对比 # Delete table (deletes nothing)
The model-side tool manage_workspace_tables is available.
Safety Boundaries (Recommended to read before use)¶
- Add-only, No Deletion: Organization only calls
workspaceRegistry.create(); it does not delete workspaces, directories, or session history. - Restore:
unmergeonly deletes folder nodes created by this plugin that have no sessions; state is recorded in~/.dsh/better-folders/state.json. - Restore disables
autoOrganizeto prevent the deleted nodes from being automatically recreated. - Deleting a workspace registration is not equivalent to deleting disk data; repeated organization is idempotent.
HTTP API (Same-Origin)¶
The Host registers prefix routes via ctx.webServer, e.g., GET /better-folders/api/status, POST /better-folders/api/preview, POST /better-folders/api/apply, POST /better-folders/api/unmerge, etc. (See the repository README for the full list).
Installation and Activation¶
The plugin is built from source and written into the DSH profile; the README does not provide a one-line command like dsh plugin add. The current package version is 0.5.2 (MIT), requiring Node >= 22.5 and peer dependency @deepseek-ai/dsh (>=0.1.2-rc.1), etc.
The following steps are from the repository README: build first, optionally dry-run, then install to the profile (the example uses web; desktop versions often use desktop, which must match the currently active profile).
npm install
npm run build
npm test
node tools/install-into-profile.mjs --profile web --dry-run
node tools/install-into-profile.mjs --profile web
After obtaining the source code from GitHub, execute in the same directory:
git clone https://github.com/huguangyu666/dsh-plugin-better-folders.git
cd dsh-plugin-better-folders
npm install && npm run build
node tools/install-into-profile.mjs --profile web
Restart DSH after installation; desktop versions also require a page refresh to load the client half. To uninstall:
node tools/install-into-profile.mjs --profile web --uninstall
You can check the introduction and category in the DSH community plugin directory SkillHub Entry; the directory site represents the community ecosystem and has no official affiliation with DeepSeek or High-Flyer. Please read the source code and license yourself before installing; the plugin runs under the current DSH process permissions.
Typical Usage¶
After installation and restart, no extra operations are usually needed:
- Auto Organization runs once approximately 4 seconds after startup, registering qualified parent directories as folder nodes.
- If
autoTreeViewis true and mergeable directories exist, the client will attempt to switch the sidebar to “Workspace Tree”. If this view is not switched to, the list may just show a few extra entries without visible collapsing.
Manual flow:
- Open Settings → Plugins → Better DSH Folders.
- Click Preview to view the folder nodes that will be created.
- Click One-click Organize; if necessary, manually switch in View Options → Group By → Workspace Tree, or refresh the page.
- If unsatisfied, click Restore (this turns off auto-organize; you need to reopen
autoOrganizein the panel if you still want automatic merging).
Commands in chat:
/folders # View current status
/folders plan # Preview
/folders organize # Execute organization
/folders unmerge # Restore
If you don’t see results, the README suggests checking: whether the profile corresponds to the current process, whether the client half is loaded, and whether the grouping is “Workspace Tree”. Troubleshooting info can be written to ~/.dsh/better-folders/diag.json (Interface /better-folders/api/diag).
Use Cases and Notes¶
- Suitable for: Multiple DSH workspaces registered under the same parent directory (multiple plugin repos, demos, sandboxes), wanting sidebar collapsing by folder, and willing to use the official “Workspace Tree” instead of third-party DOM-modifying solutions.
- Suitable for: Need to collect workspaces from scattered paths into custom “Tables” to browse by collection in the sidebar, or even drill down to session-level jumps.
- Note: Merging relies on “registering parent directories as workspaces”;
minChildrenandmaxDepthdetermine which directories become nodes. Restore only targets plugin-created nodes without sessions. - Note: Installation involves local building and
install-into-profile.mjs. Please only operate with trusted sources (the GitHub repo above) and confirm the target profile.
Conclusion¶
Better DSH Folders converges the problem of “too many sibling directories making the flat sidebar hard to navigate” into configurable registration and view switching: the algorithm plans and creates nodes on the Host side, while display is delegated to DSH’s built-in workspace tree. It also includes tables, slash commands, agent tools, and an HTTP API, facilitating shared organization logic for both humans and automation.
- Community Directory: https://www.skillhub.cn/plugins/huguangyu666/dsh-plugin-better-folders
- Source Code & Full Docs: https://github.com/huguangyu666/dsh-plugin-better-folders